ui: switch redesign (#6459)
Some checks are pending
/ release (push) Waiting to run
testing / test-remote-cacher (redis) (push) Blocked by required conditions
testing / backend-checks (push) Waiting to run
testing / frontend-checks (push) Waiting to run
testing / test-unit (push) Blocked by required conditions
testing / test-e2e (push) Blocked by required conditions
testing / test-remote-cacher (valkey) (push) Blocked by required conditions
testing / test-remote-cacher (garnet) (push) Blocked by required conditions
testing / test-remote-cacher (redict) (push) Blocked by required conditions
testing / test-mysql (push) Blocked by required conditions
testing / test-pgsql (push) Blocked by required conditions
testing / test-sqlite (push) Blocked by required conditions
testing / security-check (push) Blocked by required conditions

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6459
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
This commit is contained in:
0ko 2025-01-05 18:46:47 +00:00
parent 68d690b6b9
commit a23cf58d47
4 changed files with 28 additions and 3 deletions

View file

@ -1,4 +1,4 @@
<h2 class="ui compact small menu small-menu-items issue-list-navbar"> <div class="switch">
<a class="{{if .PageIsLabels}}active {{end}}item" href="{{.RepoLink}}/labels">{{ctx.Locale.Tr "repo.labels"}}</a> <a class="{{if .PageIsLabels}}active {{end}}item" href="{{.RepoLink}}/labels">{{ctx.Locale.Tr "repo.labels"}}</a>
<a class="{{if .PageIsMilestones}}active {{end}}item" href="{{.RepoLink}}/milestones">{{ctx.Locale.Tr "repo.milestones"}}</a> <a class="{{if .PageIsMilestones}}active {{end}}item" href="{{.RepoLink}}/milestones">{{ctx.Locale.Tr "repo.milestones"}}</a>
</h2> </div>

View file

@ -1,4 +1,4 @@
<div class="small-menu-items ui compact tiny menu"> <div class="switch">
<a class="{{if eq .State "open"}}active {{end}}item" href="{{.OpenLink}}" data-test-name="open-issue-count"> <a class="{{if eq .State "open"}}active {{end}}item" href="{{.OpenLink}}" data-test-name="open-issue-count">
{{if .PageIsMilestones}} {{if .PageIsMilestones}}
{{svg "octicon-milestone" 16 "tw-mr-2"}} {{svg "octicon-milestone" 16 "tw-mr-2"}}

View file

@ -17,6 +17,7 @@
@import "./modules/checkbox.css"; @import "./modules/checkbox.css";
@import "./modules/modal.css"; @import "./modules/modal.css";
@import "./modules/switch.css";
@import "./modules/select.css"; @import "./modules/select.css";
@import "./modules/tippy.css"; @import "./modules/tippy.css";
@import "./modules/breadcrumb.css"; @import "./modules/breadcrumb.css";

View file

@ -0,0 +1,24 @@
.switch {
display: grid;
grid-auto-flow: column;
align-items: center;
background: var(--color-menu);
border: 1px solid var(--color-input-border);
border-radius: var(--border-radius);
}
.switch .item {
color: var(--color-text);
padding: .5em 1.125em;
border-radius: var(--border-radius);
text-wrap: nowrap;
}
.switch .active.item {
background: var(--color-active);
outline: 1px solid var(--color-input-border);
}
.switch .item svg {
vertical-align: sub;
}