Skip to content

Commit 507280b

Browse files
author
0ko
committed
fix(ui): use gap in switch items (go-gitea#7581)
Followup to PRs where the old switches were converted to this one. The main change here is to the switch with counter. It was missing a gap. Additionally, it removes tailwind helpers the other switches retained from before switch refactors, because they are now using gap. Preview: https://codeberg.org/attachments/6191f55e-0b61-49fa-ba8f-cd9c93ca7bd4 https://codeberg.org/attachments/a03fb681-45b7-40f5-929e-55154abeb20d No visual change to the ones with icons. Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7581 Reviewed-by: Gusted <[email protected]>
1 parent acf6c13 commit 507280b

File tree

6 files changed

+14
-13
lines changed

6 files changed

+14
-13
lines changed

templates/projects/list.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
<div class="tw-flex tw-justify-between tw-mb-4">
33
<div class="switch list-header-toggle">
44
<a class="item{{if not .IsShowClosed}} active{{end}}" href="?state=open&q={{$.Keyword}}">
5-
{{svg "octicon-project-symlink" 16 "tw-mr-2"}}
5+
{{svg "octicon-project-symlink" 16}}
66
{{ctx.Locale.PrettyNumber .OpenCount}}&nbsp;{{ctx.Locale.Tr "repo.issues.open_title"}}
77
</a>
88
<a class="item{{if .IsShowClosed}} active{{end}}" href="?state=closed&q={{$.Keyword}}">
9-
{{svg "octicon-check" 16 "tw-mr-2"}}
9+
{{svg "octicon-check" 16}}
1010
{{ctx.Locale.PrettyNumber .ClosedCount}}&nbsp;{{ctx.Locale.Tr "repo.issues.closed_title"}}
1111
</a>
1212
</div>

templates/repo/graph.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@
4848
</div>
4949
<div class="switch">
5050
<button id="flow-color-monochrome" class="{{if eq .Mode "monochrome"}}active {{end}}item" title="{{ctx.Locale.Tr "repo.commit_graph.monochrome"}}">
51-
{{svg "material-invert-colors" 16 "tw-mr-1"}}
51+
{{svg "material-invert-colors" 16}}
5252
{{ctx.Locale.Tr "repo.commit_graph.monochrome"}}
5353
</button>
5454
<button id="flow-color-colored" class="{{if ne .Mode "monochrome"}}active {{end}}item" title="{{ctx.Locale.Tr "repo.commit_graph.color"}}">
55-
{{svg "material-palette" 16 "tw-mr-1"}}
55+
{{svg "material-palette" 16}}
5656
{{ctx.Locale.Tr "repo.commit_graph.color"}}
5757
</button>
5858
</div>

templates/repo/issue/openclose.tmpl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
<div class="switch">
22
<a class="{{if eq .State "open"}}active {{end}}item" href="{{.OpenLink}}" data-test-name="open-issue-count">
33
{{if .PageIsMilestones}}
4-
{{svg "octicon-milestone" 16 "tw-mr-2"}}
4+
{{svg "octicon-milestone" 16}}
55
{{else if .PageIsPullList}}
6-
{{svg "octicon-git-pull-request" 16 "tw-mr-2"}}
6+
{{svg "octicon-git-pull-request" 16}}
77
{{else}}
8-
{{svg "octicon-issue-opened" 16 "tw-mr-2"}}
8+
{{svg "octicon-issue-opened" 16}}
99
{{end}}
1010
{{ctx.Locale.PrettyNumber .OpenCount}}&nbsp;{{ctx.Locale.Tr "repo.issues.open_title"}}
1111
</a>
1212
<a class="{{if eq .State "closed"}}active {{end}}item" href="{{.ClosedLink}}" data-test-name="closed-issue-count">
13-
{{svg "octicon-issue-closed" 16 "tw-mr-2"}}
13+
{{svg "octicon-issue-closed" 16}}
1414
{{ctx.Locale.PrettyNumber .ClosedCount}}&nbsp;{{ctx.Locale.Tr "repo.issues.closed_title"}}
1515
</a>
1616
{{if not .PageIsMilestones}}
1717
<a class="{{if eq .State "all"}}active {{end}}item" href="{{.AllStatesLink}}" data-test-name="all-issue-count">
18-
{{svg "octicon-eye" 16 "tw-mr-2"}}
18+
{{svg "octicon-eye" 16}}
1919
{{ctx.Locale.PrettyNumber (.AllCount)}}&nbsp;{{ctx.Locale.Tr "repo.issues.all_title"}}
2020
</a>
2121
{{end}}

templates/user/dashboard/issues.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
<div class="list-header">
77
<div class="switch list-header-toggle">
88
<a class="item{{if not .IsShowClosed}} active{{end}}" href="?type={{$.ViewType}}&sort={{$.SortType}}&state=open&labels={{.SelectLabels}}&q={{$.Keyword}}">
9-
{{svg "octicon-issue-opened" 16 "tw-mr-2"}}
9+
{{svg "octicon-issue-opened" 16}}
1010
{{ctx.Locale.PrettyNumber .IssueStats.OpenCount}}&nbsp;{{ctx.Locale.Tr "repo.issues.open_title"}}
1111
</a>
1212
<a class="item{{if .IsShowClosed}} active{{end}}" href="?type={{$.ViewType}}&sort={{$.SortType}}&state=closed&labels={{.SelectLabels}}&q={{$.Keyword}}">
13-
{{svg "octicon-issue-closed" 16 "tw-mr-2"}}
13+
{{svg "octicon-issue-closed" 16}}
1414
{{ctx.Locale.PrettyNumber .IssueStats.ClosedCount}}&nbsp;{{ctx.Locale.Tr "repo.issues.closed_title"}}
1515
</a>
1616
</div>

templates/user/dashboard/milestones.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@
3737
<div class="list-header">
3838
<div class="switch list-header-toggle">
3939
<a class="item{{if not .IsShowClosed}} active{{end}}" href="?repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort={{$.SortType}}&state=open&q={{$.Keyword}}">
40-
{{svg "octicon-milestone" 16 "tw-mr-2"}}
40+
{{svg "octicon-milestone" 16}}
4141
{{ctx.Locale.PrettyNumber .MilestoneStats.OpenCount}}&nbsp;{{ctx.Locale.Tr "repo.issues.open_title"}}
4242
</a>
4343
<a class="item{{if .IsShowClosed}} active{{end}}" href="?repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort={{$.SortType}}&state=closed&q={{$.Keyword}}">
44-
{{svg "octicon-check" 16 "tw-mr-2"}}
44+
{{svg "octicon-check" 16}}
4545
{{ctx.Locale.PrettyNumber .MilestoneStats.ClosedCount}}&nbsp;{{ctx.Locale.Tr "repo.issues.closed_title"}}
4646
</a>
4747
</div>

web_src/css/modules/switch.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
.switch .item {
1313
display: flex;
14+
gap: 0.5rem;
1415
align-items: center;
1516
padding: .5em 1.125em;
1617
color: var(--color-text);

0 commit comments

Comments
 (0)