-
Hello, In TailwindCSS v2 and v3, in our design system, we used to distribute a preset like this:
and projects used it like this in their import preset from "@xxx/design-tokens/tailwindcss-preset";
export default {
presets: [preset],
} I've just upgraded a project to TailwindCSS v4, so I did this: @import "tailwindcss";
@config "../tailwind.config.js"; And now I face this error for my plugin with
I know I can do all the The goal is to avoid duplications in all projects consuming our design system, in a way that we've done in the past with preset by just importing them. Thank you very much for your help. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Presets in v4 are now CSS files. You'd /* preset.css */
@theme {
--accent-color-main: var(--vp-semantic-color-background-main);
--accent-color-alternative: var(--vp-semantic-color-background-alternative);
…
}
@utility text-subtitle-m {
/**
* Try adding `@reference "tailwindcss/theme.css"` at the top of this file if
* you get unknown variant errors.
*/
@variant sm {
text-transform: var(--vp-semantic-typography-screen-s-subtitle-m-text-case);
text-decoration: var(--vp-semantic-typography-screen-s-subtitle-m-text-decoration);
…
}
} @import "tailwindcss";
@import "@xxx/design-tokens/tailwindcss-preset"; |
Beta Was this translation helpful? Give feedback.
Presets in v4 are now CSS files. You'd
@import
these CSS files into your own. So: