From dbadcd93b25b78fcfc79d638bfc638155b38196a Mon Sep 17 00:00:00 2001 From: Limon Monte <6059356+limonte@users.noreply.github.com> Date: Wed, 5 Aug 2026 14:45:05 +0300 Subject: [PATCH] perf: replace Font Awesome with inline SVG icons Font Awesome 4 is EOL and was pulled from jsdelivr as a render-blocking stylesheet, then downloaded a whole icon webfont, to draw 3 glyphs of site chrome. With animate.css already bundled in #270, removing it takes the last third-party stylesheet off the critical path. - new src/components/UiIcons.tsx: IconBars, IconArrowLeft, IconExternalLink as inline SVG, sized in em so they scale with the inherited font-size and inherit text colour. All decorative, so aria-hidden - every call site has adjacent text or its own aria-label. - .ui-icon in styles.scss nudges them onto the text baseline where the webfont glyphs sat. - the example code in src/examples/functions.ts uses emoji instead: those snippets are displayed verbatim as documentation, so inlining SVG there would wreck them. Existing aria labels are unchanged. - drop the font-awesome , and with it the now-dead jsdelivr preconnect from #267. No stylesheet is loaded from a third party any more. The remaining external origins are all deferred, after-mount, or on-demand, so they keep dns-prefetch only. The stray fa-info-circle in validation-message-custom-icon-src.tsx is left alone: it runs inside Sandpack, which only ever injects sweetalert2 and never had Font Awesome, so it was already not rendering. Pre-existing and untouched by this change. Part of #259 Co-Authored-By: Claude Opus 5 (1M context) --- partials/head.html | 20 ++++--------- src/components/Examples.tsx | 3 +- src/components/Installation.tsx | 3 +- src/components/Nav.tsx | 5 ++-- src/components/UiIcons.tsx | 50 +++++++++++++++++++++++++++++++++ src/examples/functions.ts | 6 ++-- styles/styles.scss | 7 +++++ 7 files changed, 73 insertions(+), 21 deletions(-) create mode 100644 src/components/UiIcons.tsx diff --git a/partials/head.html b/partials/head.html index 13e00deb..8714cd2d 100644 --- a/partials/head.html +++ b/partials/head.html @@ -9,18 +9,13 @@ - @@ -51,9 +46,6 @@ - - -