fix vertical alignment of github stars button in all states (#3006)

Without uBlock, the button's alt-text would be 1px lower than the rest
of the nav items, and inconsistently capitalized.

With uBlock, the button would be slightly too high up.

This is on Firefox.

The solution is to apply styles on the `span` that GitHub's JS inserts.
However, using margin will make the entire nav jump during pageload, so
position: relative seems more robust there.
This commit is contained in:
Markus Unterwaditzer 2024-11-14 04:29:30 +01:00 committed by GitHub
parent 82eb2a635a
commit 8d07de9708
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 3 deletions

View File

@ -419,8 +419,9 @@ transition: visibility 0s 1s, opacity 1s linear;
padding:1em 0;
}
.github-stars {
margin-top: 5px;
.github-stars span {
position: relative;
top: 4px;
}
/* Content */

View File

@ -54,7 +54,7 @@
</div>
<div>
<div class="github-stars" hx-preserve="true" id="github-stars">
<a class="github-button" href="https://github.com/bigskysoftware/htmx" data-color-scheme="no-preference: light; light: light; dark: dark;" data-icon="octicon-star" data-show-count="true" aria-label="Star bigskysoftware/htmx on GitHub">Star</a>
<a class="github-button" href="https://github.com/bigskysoftware/htmx" data-color-scheme="no-preference: light; light: light; dark: dark;" data-icon="octicon-star" data-show-count="true" aria-label="Star bigskysoftware/htmx on GitHub">star</a>
</div>
</div>
</div>