atlowChemi / vite-svg-2-webfont

A vite plugin which generates a webfont out of svg icons
https://www.npmjs.com/package/vite-svg-2-webfont
MIT License
24 stars 8 forks source link

Implement Font Inlining #25

Closed Azarattum closed 4 months ago

Azarattum commented 4 months ago

Addressing my suggestion in https://github.com/atlowChemi/vite-svg-2-webfont/issues/19#issuecomment-1961071304, I've added an option which allows fonts to be inlined directly into CSS as base64. This is extremely useful when there is a requirement that icons should be displayed as soon as the app loads (no empty squares or shifting layouts).

Here is a regex breakdown used in this PR: https://regex101.com/r/dnExDu/1