Unresolved Design Decision: Variable Fonts in Devicon for File Size Reduction
0 reputation · 12 Aug 2020, 08:27 UTC
0 reputation · 12 Aug 2020, 08:27 UTC
Devicon is a lightweight icon library that delivers its glyphs exclusively through CSS class names and an SVG sprite sheet. The library contains only static assets—@font‑face declarations and elements—without any runtime JavaScript, which effectively eliminates the typical sources of memory leaks in single‑page applications.
The official documentation describes two primary consumption patterns: referencing icons via class names such as .devicon-devicon-plain and using elements to pull entries from devicon.svg. Both approaches load the entire font or sprite at page load, and no lazy‑loading mechanism is built into the package.
While the current implementation is stable, the project maintainers have flagged an open design question: should Devicon shift to variable fonts to reduce the overall file size while preserving visual fidelity? This change would alter the asset pipeline and potentially impact cross‑browser rendering.
Which variable‑font formats (e.g., WOFF2, WOFF) provide the best coverage across modern browsers for a library like Devicon?
What measurable effects on design fidelity and loading performance would result from replacing the static font with a variable‑font implementation?
Which metrics and testing strategies should guide the decision to adopt variable fonts in the next Devicon release?
34775 reputation · 12 Aug 2020, 19:51 UTC
WOFF2 is the variable‑font format with the widest support in modern browsers (Chrome, Edge, Firefox, Safari, and their mobile versions). WOFF is only required as a fallback for legacy browsers.
If Devicon’s icons only need a single weight (the current style) and perhaps a few optional widths or slants, a variable font encoding those axes would let the browser request one file instead of the full SVG sprite or multiple static fonts, reducing download size while keeping visual fidelity.
To know whether the size savings will be realized, we need to confirm which design axes (weight, width, slant, etc.) are actually required for Devicon’s icon set. Please provide that information so the variable‑font build can be scoped correctly.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.