Skip to content

Commit 850fc25

Browse files
authored
Apply compact padding to small buttons with svg icons (#29471)
The buttons on the repo release tab were larger in height than on other tabs because one of them contained the RSS icon which stretched the button height by 3px. Workaround this problem by applying the "compact" padding to any such button. They are within 0.4px in height now to non-icon buttons. Before: <img width="406" alt="Screenshot 2024-02-28 at 15 30 23" src="https://github.com/go-gitea/gitea/assets/115237/805bb93a-6fe4-40a0-82d1-03001bee8ecf"> After: <img width="407" alt="Screenshot 2024-02-28 at 15 38 43" src="https://github.com/go-gitea/gitea/assets/115237/27707588-890f-4852-ab08-105a57eda880"> For comparison, button on issue tab: <img width="452" alt="Screenshot 2024-02-28 at 15 31 46" src="https://github.com/go-gitea/gitea/assets/115237/74ac13d5-d016-49ba-9dd9-40ed32a748e9">
1 parent 252047e commit 850fc25

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

templates/repo/release_tag_header.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
</div>
1414
{{if .EnableFeed}}
1515
<a class="ui small button" href="{{.RepoLink}}/{{if .PageIsTagList}}tags{{else}}releases{{end}}.rss">
16-
{{svg "octicon-rss" 18}} {{ctx.Locale.Tr "rss_feed"}}
16+
{{svg "octicon-rss" 16}} {{ctx.Locale.Tr "rss_feed"}}
1717
</a>
1818
{{end}}
1919
{{if and (not .PageIsTagList) .CanCreateRelease}}

web_src/css/modules/button.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,13 @@ It needs some tricks to tweak the left/right borders with active state */
8585
box-shadow: none;
8686
}
8787

88+
/* apply the vertical padding of .compact to non-compact buttons when they contain a svg as they
89+
would otherwise appear too large. Seen on "RSS Feed" button on repo releases tab. */
90+
.ui.small.button:not(.compact):has(.svg) {
91+
padding-top: 0.58928571em;
92+
padding-bottom: 0.58928571em;
93+
}
94+
8895
.ui.labeled.button.disabled > .button,
8996
.ui.basic.buttons .button,
9097
.ui.basic.button,

0 commit comments

Comments
 (0)