[Bug?]: cssChunking / CSS Optimisations - Module CSS getting reset by tailwind's global styles #69311
Labels
bug
Issue was opened via the bug report template.
create-next-app
Related to our CLI tool for quickly starting a new Next.js application.
Navigation
Related to Next.js linking (e.g., <Link>) and navigation.
Link to the code that reproduces this issue
https://github.com/GabenGar/repros/blob/main/nextjs/css-out-of-order/README.md
To Reproduce
.module.css
file.Current vs. Expected behavior
Tailwind CSS's preflight styles overwrite Tailwind CSS written inside
module CSS
.Example:
Expected Behaviour: Button color is red.
Current Behaviour: Button color is transparent since module CSS is overwritten by tailwind's preflight styles.
Provide environment information
Which area(s) are affected? (Select all that apply)
Not sure, create-next-app, Navigation
Which stage(s) are affected? (Select all that apply)
next build (local), Other (Deployed)
Additional context
We have a big legacy project where we have written tailwind classes inside module CSS by using the apply directive. At some places, these styles are being reset by Tailwind's preflight styles. This started happening after the next JS upgrade to version 14.2.5 and we are unable to move further.
I have tried the cssChunking as per the documentation but that is having no effect.
Is there any workaround? Rewriting everything back to tailwind classes is a very bandwidth heavy task for our team.
The text was updated successfully, but these errors were encountered: