Skip to content

Commit

Permalink
fix: back button icon rendering inconsistently (#2306)
Browse files Browse the repository at this point in the history
Depending on the operating system and therefore the system font
the back icon being a unicode arrow means it'll render inconsistently,
sometimes I've seen it looking really odd.

Instead make use of the font awesome arrow so that'll it render consistently
no matter ths system font.
  • Loading branch information
NickColley authored Dec 10, 2022
1 parent 97e3b04 commit 3fb152a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
1 change: 1 addition & 0 deletions bin/svgs.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export default [
{ id: 'pinafore-logo', src: 'src/static/sailboat.svg', inline: true },
{ id: 'fa-arrow-left', src: 'src/thirdparty/font-awesome-svg-png/white/svg/arrow-left.svg' },
{ id: 'fa-bell', src: 'src/thirdparty/font-awesome-svg-png/white/svg/bell.svg', inline: true },
{ id: 'fa-bell-o', src: 'src/thirdparty/font-awesome-svg-png/white/svg/bell-o.svg' },
{ id: 'fa-users', src: 'src/thirdparty/font-awesome-svg-png/white/svg/users.svg', inline: true },
Expand Down
21 changes: 15 additions & 6 deletions src/routes/_components/DynamicPageBanner.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ <h1 class="dynamic-page-title" aria-label={ariaTitle}>{title}</h1>
<button type="button"
class="dynamic-page-go-back"
aria-label="{intl.goBack}"
on:click|preventDefault="onGoBack()">{intl.back}</button>
on:click|preventDefault="onGoBack()">
<SvgIcon className="dynamic-page-go-back-icon" href="#fa-arrow-left" />
{intl.back}
</button>
</div>
<Shortcut key="Backspace" on:pressed="onGoBack()"/>
<style>
Expand All @@ -34,19 +37,25 @@ <h1 class="dynamic-page-title" aria-label={ariaTitle}>{title}</h1>
text-overflow: ellipsis;
}
.dynamic-page-go-back {
font-size: 1.3em;
display: inline-flex;
align-items: center;
justify-self: flex-end;
font-size: 1.2857142857142858em;
color: var(--anchor-text);
border: 0;
padding: 0;
background: none;
justify-self: flex-end;
}
.dynamic-page-go-back:hover {
text-decoration: underline;
}
.dynamic-page-go-back::before {
content: '←';
margin-right: 5px;
:global(.dynamic-page-go-back-icon) {
position: relative;
bottom: 0.06em;
margin-right: 0.2em;
height: 0.66666666em;
width: 0.66666666em;
fill: currentColor;
}
@media (max-width: 767px) {
.dynamic-page-banner {
Expand Down

0 comments on commit 3fb152a

Please sign in to comment.