2 ms·
> it's not hard to do, even in JavaScript But if you’re going to try to do anything fancy like this, it’s practically certainly better to do it as a build step
by chrismorgan 5y ago
> it's not hard to do, even in JavaScript
But if you’re going to try to do anything fancy like this, it’s practically certainly better to do it as a build step, because otherwise you’ll be shipping extra parser code, doing extra work, and either loading the font twice or slowing down the CSS pipeline by putting JavaScript into the critical path. Also, remember that the font may not load (e.g. user preference overriding all fonts), so don’t depend on this sort of thing for fine detail unless you’ve confirmed the font is actually being used.