To add a new font to the dashboard, you must register it in three different locations to ensure it is available in the settings UI, loaded in the browser, and accessible via Tailwind CSS classes.
- Register in
src/config/fonts.ts: Add the font name to the fonts array. This enables the font in the appearance settings and allows the generation of dynamic classes like font-[name]. - Load in
index.html: Add the appropriate <link> tag (e.g., from Google Fonts) to the <head> of your index.html file. - Define in
index.css: Add the font family to your CSS using the @theme inline block and a CSS variable. This makes the font available to Tailwind.
Example: Adding 'Roboto'
Step 1: src/config/fonts.ts
export const fonts = ['inter', 'manrope', 'system', 'roboto'] as const
Step 2: index.html
<link href="https://fonts.googleapis.com/css2?family=Roboto&display=swap" rel="stylesheet">
Step 3: index.css
@theme inline {
--font-roboto: 'Roboto', var(--font-sans);
}
export const fonts = ['inter', 'manrope', 'system'] as const