From 91a04893d6703cb139dbcb01a23ad6548f2ccc7b Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Thu, 27 Aug 2026 04:20:44 -1000 Subject: Replace `nbsp` spacing with CSS --- assets/cgit.css | 6 ++++++ custom/extensions/email-gravatar.lua | 4 ++-- custom/extensions/email-libravatar.lua | 4 ++-- source/ui-refs.c | 8 ++++---- source/ui-summary.c | 8 ++++---- 5 files changed, 18 insertions(+), 12 deletions(-) diff --git a/assets/cgit.css b/assets/cgit.css index ef6c316..ca2ce4b 100644 --- a/assets/cgit.css +++ b/assets/cgit.css @@ -426,6 +426,12 @@ div#cgit table.list tr.nohover:hover { background: var(--bg); } +/* Spacer rows between sections hold one empty cell. Cell height counts the + border box, so the vertical padding is added back on top of the line. */ +div#cgit table.list tr.nohover td:empty { + height: calc(1lh + 0.6em); +} + div#cgit table.list tr.nohover-highlight:hover:nth-child(even) { background: var(--surface-2); } diff --git a/custom/extensions/email-gravatar.lua b/custom/extensions/email-gravatar.lua index 3204ef1..85947c4 100644 --- a/custom/extensions/email-gravatar.lua +++ b/custom/extensions/email-gravatar.lua @@ -105,10 +105,10 @@ function filter_close() html("" .. alt_text ..
 			" " .. buffer) + "' loading='lazy' decoding='async'> " .. buffer) end return 0 end diff --git a/custom/extensions/email-libravatar.lua b/custom/extensions/email-libravatar.lua index eceef56..e958346 100644 --- a/custom/extensions/email-libravatar.lua +++ b/custom/extensions/email-libravatar.lua @@ -102,10 +102,10 @@ function filter_close() html("" .. alt_text ..
 			" " .. buffer) + "' loading='lazy' decoding='async'> " .. buffer) end return 0 end diff --git a/source/ui-refs.c b/source/ui-refs.c index 624d1a0..1b32088 100644 --- a/source/ui-refs.c +++ b/source/ui-refs.c @@ -85,7 +85,7 @@ static void print_branch_header(void) html("Branch" "Commit message" "Author" - "Age\n"); + "Age\n"); } static int print_branch(struct refinfo *ref) @@ -131,7 +131,7 @@ static void print_tag_header(void) html("Tag" "Download" "Author" - "Age\n"); + "Age\n"); } static int print_tag(struct refinfo *ref) @@ -155,7 +155,7 @@ static int print_tag(struct refinfo *ref) cgit_tag_link(name, NULL, NULL, name); html(""); if (ctx.repo->snapshots && (obj->type == OBJ_COMMIT)) - cgit_print_snapshot_links(ctx.repo, name, "  "); + cgit_print_snapshot_links(ctx.repo, name, " "); else cgit_object_link(obj); html(""); @@ -342,7 +342,7 @@ void cgit_print_refs(void) print_tags_page(ctx.cfg.max_ref_count); else { cgit_print_branches(ctx.cfg.max_ref_count); - html(" \n"); + html("\n"); cgit_print_tags(ctx.cfg.max_ref_count); } html("\n"); diff --git a/source/ui-summary.c b/source/ui-summary.c index 2310e5c..3658bc5 100644 --- a/source/ui-summary.c +++ b/source/ui-summary.c @@ -44,8 +44,8 @@ static void print_clone_url(const char *url) // cgit_add_clone_urls may call back no times at all, so the heading // waits for a first url rather than being printed ahead of the walk. if (clone_urls_printed++ == 0) { - htmlf(" \n", columns); - htmlf("Clone\n", columns); + htmlf("\n", columns); + htmlf("Clone\n", columns); } htmlf("\n"); cgit_print_branches(ctx.cfg.summary_branches); - htmlf(" \n", columns); + htmlf("\n", columns); cgit_print_tags(ctx.cfg.summary_tags); if (ctx.cfg.summary_log > 0) { - htmlf(" \n", columns); + htmlf("\n", columns); cgit_print_log(ctx.qry.head, 0, ctx.cfg.summary_log, NULL, NULL, NULL, 0, 0, 0); } -- cgit v2.8.0