Skip to content

How are custom fonts implemented? #3474

Answered by endigo9740
sledgehammer999 asked this question in Q&A
Discussion options

You must be logged in to vote

Ok I see what they're doing here:

On FontSource they're expecting the import to occur in a JS/TS file, which Vite supports.

// +layout.svelte
import "@fontsource/open-sans";
import "./app.css";

In our docs we're recommending folks import this in their CSS stylesheet. Which should be @import.

// app.css
@import "@fontsource/open-sans";

I'd welcome a ticket or PR to help correct this.

Replies: 2 comments 10 replies

Comment options

You must be logged in to vote
10 replies
@Sarenor
Comment options

@endigo9740
Comment options

@sledgehammer999
Comment options

@endigo9740
Comment options

Answer selected by sledgehammer999
@sledgehammer999
Comment options

@endigo9740
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants