-
Hello there, I'm trying to move on to taildwindcss 4 with a new project and I want to include the Inter font. I'm following this: https://rsms.me/inter/#usage I want to include this: :root {
font-family: Inter, sans-serif;
font-feature-settings: 'liga' 1, 'calt' 1; /* fix for Chrome */
}
@supports (font-variation-settings: normal) {
:root { font-family: InterVariable, sans-serif; }
} Into the scss file that tailwindcss have to process, but I don't know how to be done... I've downloaded the font to have it locally. Then I wanted to include the font in mi app.scss file and try it something like this: @layer theme, base, components, utilities;
@source "../js";
@source "../views";
@import "tailwindcss/theme" layer(theme);
@import "tailwindcss/preflight" layer(base);
@import "tailwindcss/utilities" layer(utilities);
@import "inter.css";
@theme {
--font-inter: Inter, sans-serif;
font-feature-settings: 'liga' 1, 'calt' 1;
@supports (font-variation-settings: normal) {
--font-inter: InterVariable, sans-serif;
}
} But it fails: [vite] Internal server error: [postcss] `@theme` blocks must only contain custom properties or `@keyframes`.
@theme {
> @supports (font-variation-settings: normal) {
> --font-inter: InterVariable, sans-serif;
> }
} So I'm looking for some ideas of how it must be done to work properly with the new tailwindcss ecosystem. Thanks in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
You could try having the @theme {
--font-inter: Inter, sans-serif;
font-feature-settings: 'liga' 1, 'calt' 1;
}
@supports (font-variation-settings: normal) {
:root {
--font-inter: InterVariable, sans-serif;
}
} |
Beta Was this translation helpful? Give feedback.
Oh yes, sorry, it'd be like: