-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf: set FontAwesome icons size always static
so they're shown when using SSR as early as possible remove from NoJS only and use always to improve SSR shifts too explain it
- Loading branch information
Showing
3 changed files
with
16 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// When JavaScript is disabled and page is pre-rendered with SSR Font Awesome icons seemed to be there in the DOM, | ||
// but without their size set. | ||
// | ||
// Seems size is set dynamically by Font Awesome library. With this trick, we make icons always appear by setting its | ||
// size. Which also helps with SSR, given there are less layout shifts. As it appears there from early beginning, not | ||
// until its size is dynamically set | ||
@mixin iconsStaticSizeFix { | ||
fa-icon > svg { | ||
/* Otherwise, doesn't display when JavaScript is disabled */ | ||
height: 100%; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters