Oli8 / spaper

PaperCSS components for Svelte
https://oli8.github.io/spaper/
MIT License
199 stars 9 forks source link

Consider adding font dependency through npm to reduce font loading related flash of unstyled text #14

Closed SumitBando closed 2 years ago

SumitBando commented 2 years ago

For local development, downloading fonts from google cdn adds a flash due to font replacement.

This can be eliminated by using local fonts. Instead of adding the font reference in the css file, you can add them through package.json

"dependencies": { "@fontsource/neucha": "^4.5.0", "@fontsource/patrick-hand-sc": "^4.5.0", ... }

then in some source file: import '@fontsource/patrick-hand-sc'; import '@fontsource/neucha';

Oli8 commented 2 years ago

Fonts are loaded in papercss stylesheet.