Variables not being read after loading tailwind inside a container #17742
-
What version of Tailwind CSS are you using? v4.1.4 What build tool (or framework if it abstracts the build tool) are you using? Vite v6.2.6 What version of Node.js are you using? For example: v22.14.0 What browser are you using? Chrome (Arc) What operating system are you using? macOS Reproduction URL Describe your issue I am trying to import tailwind inside a container, as we are using multiple versions of tailwind through a plugin system. (module federation) This is how I am importing tailwind
Which seems to work fine, except that tailwind variables are not working after build.
which seems to be causing this issue, as |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hey! Do you mind adding a reproduction of your setup so others can take a look? This piece of code you added does not appear to be valid CSS. .plugin-container {
@import "tailwindcss";
} |
Beta Was this translation helpful? Give feedback.
Ah, yep, you can do this by ejecting from the default imports and scoping the utility layer relying on CSS nesting, so instead of:
You'd do:
This will insert all utilities in the place where
@tailwind utilities;
is located which will be inside the utilities layer but also require a.plugin-container
class in the parent tree!