perf: Replace Font Awesome with inline svg icons#890
Open
lfrancke wants to merge 1 commit into
Open
Conversation
30b206b to
f38363b
Compare
ebb98f1 to
7af036a
Compare
Font Awesome shipped 137 kB of css and eight webfont files for seven glyphs: the external-link arrow, the search magnifier, the glossary link icon and four social icons in the footer. Those are inline svgs now (path data from Font Awesome Free 6.2.1, CC BY 4.0, attributed in ui/NOTICE), sized and colored via a small .svg-icon utility class. site.css shrinks from 146 kB to 48 kB and the webfonts/ directory disappears from the bundle. The fa-* checklist selectors in doc.css stay: they come from upstream and draw the check marks with css content, independent of any icon font. Also removes the inlineDynamicImports rollup option (vite 8 warns it is redundant for non-code-split builds).
f38363b to
c68ab8d
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Second slice of the performance batch, stacked on #889 (retargets to main when that merges).
Font Awesome shipped 137 kB of css + eight webfont files (~350 kB) for exactly seven glyphs: the external-link arrow ({external-link-icon} in the playbooks + 4 uses in the universal navbar), the search magnifier, the glossary link icon, and the xing/linkedin/github/twitter icons in the footer.
.svg-iconutility class for fill/alignment, sizes matching the previous fa-xs/fa-sm/default rendering.site.css: 146 kB → 48 kB.webfonts/disappears from the bundle.fa-*checklist selectors in doc.css stay - upstream draws those check marks with csscontent, no icon font involved.inlineDynamicImportsrollup option that Vite 8 warns is redundant.Review hint
Since this is stacked, there's no automatic deploy preview. The icons to eyeball once #889 merges (or via a temporary draft PR against main): external-link arrows in the top navbar and content links, the search icon in the header, footer social icons, and the glossary's link icons.