V4 compatibilitiy issue when bundled styles used in v3 consumer (@layer base
is used but no matching @tailwind base
directive is present.)
#17954
Unanswered
berkerdemirer
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey,
I need help with my current scenario in which I export a library using tailwindv4 styles and try to use it within tailwindv3 project. The error I am getting is
@layer base` is used but no matching `@tailwind base` directive is present.
Here is my config:index.css of the library:
In the consumer app that uses Tailwind V3, I import the styles from my library in the main.tsx
import '@package/path/style.css'
;But, when I run the application i get:
Now this is bad, because my library shouldn't be affected by the consumer's version or at least it should work backwards compatible. I don't know if similar problem would occur if consumer was on v4 and library on v3. I also can't ask my consumers to adjust their tailwind version, or break their app if they decide to upgrade.
Due to nature of the bundling I am not able to inject the styles like you would in css-in-js libraries and get rid of the import styles statement in the consumer.
I really need help, maybe I am missing something here.
Beta Was this translation helpful? Give feedback.
All reactions