feat(ui): improve button gap consistency, make it variable, larger on touchscreens (#7271)
* home buttons: use `button-sequence` for consistency of gaps with other ui * folder-actions: use `button-sequence` for better overflowing and so gap actually works instead of relying on whitespace, because currently it doesn't due to lack of flex * introduce variable `--button-spacing` for `button-row` and `button-sequence` * it's `0.33rem` on desktop for more pleasant hovering over button rows * it's `0.5rem` on touchscreens for worrying less about misstapping Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7271 Reviewed-by: Gusted <gusted@noreply.codeberg.org> Co-authored-by: 0ko <0ko@noreply.codeberg.org> Co-committed-by: 0ko <0ko@noreply.codeberg.org>
This commit is contained in:
parent
2457f5ff22
commit
7990bcf333
2 changed files with 12 additions and 5 deletions
|
@ -56,8 +56,8 @@
|
|||
{{$l := Eval $n "-" 1}}
|
||||
{{$isHomepage := (eq $n 0)}}
|
||||
<div class="repo-button-row">
|
||||
<div class="tw-flex tw-items-center tw-gap-y-2">
|
||||
{{template "repo/branch_dropdown" dict "root" . "ContainerClasses" "tw-mr-1"}}
|
||||
<div class="tw-gap-y-2 button-sequence">
|
||||
{{template "repo/branch_dropdown" dict "root" .}}
|
||||
{{if and .CanCompareOrPull .IsViewBranch (not .Repository.IsArchived)}}
|
||||
{{$cmpBranch := ""}}
|
||||
{{if ne .Repository.ID .BaseRepo.ID}}
|
||||
|
@ -141,7 +141,7 @@
|
|||
{{template "repo/cite/cite_modal" .}}
|
||||
{{end}}
|
||||
{{if and (not $isHomepage) (not .IsViewFile) (not .IsBlame)}}{{/* IsViewDirectory (not home), TODO: split the templates, avoid using "if" tricks */}}
|
||||
<div class="button-row folder-actions">
|
||||
<div class="button-sequence folder-actions">
|
||||
<a class="ui button" href="{{.RepoLink}}/commits/{{.BranchNameSubURL}}/{{.TreePath | PathEscapeSegments}}">
|
||||
{{svg "octicon-history" 16 "tw-mr-2"}}{{ctx.Locale.Tr "repo.file_history"}}
|
||||
</a>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue