|
1 | 1 | /** |
2 | | - * List of available font names (visit the url`/settings/appearance`). |
3 | | - * This array is used to generate Tailwind's `safelist` inside 'tailwind.config.js' and 'appearance-form.tsx' |
4 | | - * to prevent dynamic font classes (e.g., `font-inter`, `font-manrope`) from being removed during purging. |
| 2 | + * List of available font names (visit the url `/settings/appearance`). |
| 3 | + * This array is used to generate dynamic font classes (e.g., `font-inter`, `font-manrope`). |
5 | 4 | * |
6 | | - * 📝 How to Add a New Font: |
| 5 | + * 📝 How to Add a New Font (Tailwind v4+): |
7 | 6 | * 1. Add the font name here. |
8 | 7 | * 2. Update the `<link>` tag in 'index.html' to include the new font from Google Fonts (or any other source). |
9 | | - * 3. Add new fontFamily 'tailwind.config.js' |
| 8 | + * 3. Add the new font family to 'index.css' using the `@theme inline` and `font-family` CSS variable. |
10 | 9 | * |
11 | 10 | * Example: |
12 | 11 | * fonts.ts → Add 'roboto' to this array. |
13 | 12 | * index.html → Add Google Fonts link for Roboto. |
14 | | - * tailwind.config.js → Add the new font inside `theme.extend.fontFamily`. |
15 | | - * ```ts |
16 | | - * theme: { |
17 | | - * // other configs |
18 | | - * extend: { |
19 | | - * fontFamily: { |
20 | | - * inter: ['Inter', ...fontFamily.sans], |
21 | | - * manrope: ['Manrope', ...fontFamily.sans], |
22 | | - * roboto: ['Roboto', ...fontFamily.sans], // Add new font here |
23 | | - * } |
| 13 | + * index.css → Add the new font in the CSS, e.g.: |
| 14 | + * @theme inline { |
| 15 | + * // ... other font families |
| 16 | + * --font-roboto: 'Roboto', var(--font-sans); |
24 | 17 | * } |
25 | | - * } |
26 | | - * ``` |
27 | 18 | */ |
28 | 19 | export const fonts = ['inter', 'manrope', 'system'] as const |
0 commit comments