Re:WebP: The WebPage Compression Format
by lifthrasiir on Sunday September 08, 2024 @12:02AM
(#41478127)
I think at least some recent tools will produce ligatures to turn a plain text into an icon to avoid this issue.
Re:WebP: The WebPage Compression Format
by alpaca128 on Sunday September 08, 2024 @08:12AM
(#41479944)
Another detail is that this feature breaks and makes some sites nearly unusable if the browser is set to ignore a website's custom fonts.
Re:WebP: The WebPage Compression Format
by yencabulator on Sunday September 08, 2024 @10:46AM
(#41480713)
More reasonable than this class+CSS would be e.g. a React/static-website-template/etc custom element that outputs the correct glyph. The output doesn't need to contain this indirection, and all of the possibilities.
This is a reasonable approach if you have a large number of icons across large parts of the site, but you should always compile the CSS/icon set down to only those used.
If only a few icons, and the icons are small, then inlining the SVG is a better option. But if you have too many SVGs directly embedded on the site, the page size itself will suffer.
As always with website optimization, whether something is a good option always “depends”.