From 6eb5efb6bb4dc7caeec60099050431f19b7c27b3 Mon Sep 17 00:00:00 2001 From: silverwind Date: Wed, 11 Nov 2026 10:33:15 +0000 Subject: [PATCH] fix(ui): consistent spacing between labels (#40261) The issue reference popup showed its labels without any spacing, and the other label lists each used their own gap, with wrapped rows spaced differently from columns. `.labels-list` is now a wrapping flex list with `--gap-inline` by default, giving the popup, issue sidebar and project cards equal gaps in both directions. Lists inline with text, in issue list titles and timeline events, stay inline so their labels still wrap one by one. Issue reference popup, issue sidebar and issue
list labels, before and after --- templates/shared/issuelist.tmpl | 2 +- web_src/css/modules/label.css | 23 ++++++++++++++++++----- web_src/css/repo.css | 6 ------ web_src/css/repo/issue-card.css | 2 +- 4 files changed, 20 insertions(+), 13 deletions(-) diff --git a/templates/shared/issuelist.tmpl b/templates/shared/issuelist.tmpl index 2655ea57361..454b99c24bd 100644 --- a/templates/shared/issuelist.tmpl +++ b/templates/shared/issuelist.tmpl @@ -17,7 +17,7 @@
-
+
{{$issue.Title | ctx.RenderUtils.RenderIssueSimpleTitle}} {{if $issue.IsPull}} {{if (index $root.CommitStatuses $issue.PullRequest.ID)}} diff --git a/web_src/css/modules/label.css b/web_src/css/modules/label.css index 34997e16d9d..9f6c34c0a9c 100644 --- a/web_src/css/modules/label.css +++ b/web_src/css/modules/label.css @@ -224,10 +224,12 @@ a.ui.ui.ui.grey.label:hover { } /* labels-list layout: span.labels-list > a.item > span.ui.label, -by default, the labels list is rendered as "display: inline", -it can also be rendered as flex by adding flex-related classes (the general ".item" selector also applies) */ +by default, the labels list is rendered as a wrapping flex list, +lists flowing inline with text (issue title, comment event) are rendered as "display: inline" below */ .labels-list { - max-width: 100%; /* for ellipsis */ + display: flex; + flex-wrap: wrap; + gap: var(--gap-inline); font-size: var(--font-size-label); /* must match the label font size, otherwise the height mismatches */ } @@ -240,19 +242,30 @@ it can also be rendered as flex by adding flex-related classes (the general ".it } .labels-list .ui.label { + display: flex; /* block-level, so items have no line box and wrapped rows get the same gap as columns */ min-height: 20px; padding-top: 0; padding-bottom: 0; } +#issue-list .labels-list, +.timeline-item .labels-list { + display: inline; +} + +#issue-list .labels-list .ui.label, +.timeline-item .labels-list .ui.label { + display: inline-flex; +} + /* to align with different font sizes, these styles need to be written separately */ #issue-list .labels-list > .item { - margin-right: 4px; /* margin-right (not margin-left) keeps wrapped labels left-aligned */ + margin-right: var(--gap-inline); /* margin-right (not margin-left) keeps wrapped labels left-aligned */ vertical-align: 2.5px; /* compensates inline-flex baseline so labels center with text */ } .timeline-item .labels-list > .item { - margin-right: 4px; + margin-right: var(--gap-inline); vertical-align: 1.5px; } diff --git a/web_src/css/repo.css b/web_src/css/repo.css index 3fd5c97bd8c..1e6de67a8bb 100644 --- a/web_src/css/repo.css +++ b/web_src/css/repo.css @@ -85,12 +85,6 @@ padding: 8px; } -.issue-content-right .ui.list.labels-list { - display: flex; - gap: var(--gap-inline); - flex-wrap: wrap; -} - .issue-content-right .empty-list { font-size: 12px; } diff --git a/web_src/css/repo/issue-card.css b/web_src/css/repo/issue-card.css index 327919b1fe6..282aba1a00f 100644 --- a/web_src/css/repo/issue-card.css +++ b/web_src/css/repo/issue-card.css @@ -36,7 +36,7 @@ display: flex; flex: 1; align-items: center; - gap: 0.25em; + gap: var(--gap-inline); flex-wrap: wrap; overflow: hidden; max-width: fit-content;