You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
perf: Replace Font Awesome with inline svg icons (#890)
* perf: Replace Font Awesome with inline svg icons
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).
* perf: Serve the svg icons from a sprite instead of inlining them
All seven icons live as symbols in img/icons.svg; usage sites reference
them with <use>, which keeps the markup readable and the path data in
one reusable, cacheable place. currentColor inheritance works through
<use>, so the .svg-icon styling is unchanged. Antora relativizes the
root-relative sprite url in page content, so the external-link-icon
attribute works from any page depth.
The universal-nav partials keep their own pre-existing inline svgs;
they can move into the sprite when that area is next touched.
0 commit comments