SvelteKit
To include Fontsource into your Svelte / SvelteKit project and apply it to your application’s typography, follow the steps below.
Installation
First, install your chosen font package:
⬤⬤
sh
1. Layout Import
Import fonts in your root layout for application-wide availability:
⬤⬤
html
2. CSS File Import
Create a global CSS file and import it in your layout:
⬤⬤
css
⬤⬤
html
3. Component-Level Import
For better code splitting, import fonts in specific components or routes:
⬤⬤
html