mirror of
https://github.com/go-gitea/gitea.git
synced 2024-09-24 10:41:12 +02:00
a96c73f979
Fix regression from https://github.com/go-gitea/gitea/pull/24476 where
the `svg.svg` class misaligns SVG icons across the site and streched
buttons unintentionally in vertical height.
Before (button 30.3px):
<img width="157" alt="Screenshot 2023-05-11 at 22 09 42"
src="https://github.com/go-gitea/gitea/assets/115237/0fd137ab-ab52-4cf8-afca-c45776d526d0">
After (button 30px):
<img width="160" alt="Screenshot 2023-05-11 at 22 09 59"
src="https://github.com/go-gitea/gitea/assets/115237/4b741f4b-0fd2-4fae-9bee-16a7deb098e8">
[vertical-align:
middle](https://developer.mozilla.org/en-US/docs/Web/CSS/vertical-align)
is not suitable to align icons to text because
> Aligns the middle of the element with the baseline plus half the
x-height of the parent.
Example of `vertical-align: middle` from MDN:
<img width="232" alt="Screenshot 2023-05-11 at 22 29 28"
src="https://github.com/go-gitea/gitea/assets/115237/179fb756-85a1-4cab-8219-1a4958f333e2">
So I think the
[existing](365bb77a54/web_src/css/svg.css (L3)
)
`vertical-align: text-top` is generally still the best bet:
<img width="241" alt="Screenshot 2023-05-11 at 22 34 24"
src="https://github.com/go-gitea/gitea/assets/115237/0cd6edf5-12c0-4bdb-8771-a900f5ba2d35">
Co-authored-by: Giteabot <teabot@gitea.io>
28 lines
1.1 KiB
Handlebars
28 lines
1.1 KiB
Handlebars
{{$canReadReleases := $.Permission.CanRead $.UnitTypeReleases}}
|
|
{{$canReadCode := $.Permission.CanRead $.UnitTypeCode}}
|
|
|
|
{{if $canReadReleases}}
|
|
<div class="gt-df">
|
|
<div class="gt-f1">
|
|
<h2 class="ui compact small menu header small-menu-items">
|
|
<a class="{{if .PageIsReleaseList}}active {{end}}item" href="{{.RepoLink}}/releases">{{.locale.Tr "repo.release.releases"}}</a>
|
|
{{if $canReadCode}}
|
|
<a class="{{if .PageIsTagList}}active {{end}}item" href="{{.RepoLink}}/tags">{{.locale.Tr "repo.release.tags"}}</a>
|
|
{{end}}
|
|
</h2>
|
|
{{if .EnableFeed}}
|
|
<a class="rss-icon gt-mx-3" href="{{.RepoLink}}/{{if .PageIsTagList}}tags{{else}}releases{{end}}.rss" data-tooltip-content="{{.locale.Tr "rss_feed"}}">{{svg "octicon-rss" 18}}</a>
|
|
{{end}}
|
|
</div>
|
|
{{if and (not .PageIsTagList) .CanCreateRelease}}
|
|
<a class="ui right small green button" href="{{$.RepoLink}}/releases/new">
|
|
{{.locale.Tr "repo.release.new_release"}}
|
|
</a>
|
|
{{end}}
|
|
</div>
|
|
<div class="ui divider"></div>
|
|
{{else if $canReadCode}}
|
|
{{/* if the "repo.releases" unit is disabled, only show the "commits / branches / tags" sub menu */}}
|
|
{{template "repo/sub_menu" .}}
|
|
{{end}}
|