mirror of
https://github.com/go-gitea/gitea.git
synced 2026-11-19 15:14:40 +09:00
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. <img width="600" alt="Issue reference popup, issue sidebar and issue list labels, before and after" src="https://github.com/user-attachments/assets/fc4f0b9e-2b9d-4060-a2fb-c1bd3b7391db" />
This commit is contained in:
1 parent
c62bcf19f6
commit
6eb5efb6bb
4 files changed
+20
-13
No files matched your search
@@ -17,7 +17,7 @@
|
||||
|
||||
<div class="item-main">
|
||||
<div class="item-header">
|
||||
<div>
|
||||
<div class="tw-min-w-0">
|
||||
<a class="list-item-large-title" href="{{if $issue.Link}}{{$issue.Link}}{{else}}{{$root.Link}}/{{$issue.Index}}{{end}}">{{$issue.Title | ctx.RenderUtils.RenderIssueSimpleTitle}}</a>
|
||||
{{if $issue.IsPull}}
|
||||
{{if (index $root.CommitStatuses $issue.PullRequest.ID)}}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user