-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
::before, ::after" is not pure (pure selectors must contain at least one local class or id) #6717
Comments
Hey! This is because you are trying to put Tailwind’s base styles in a CSS module, and CSS modules can’t contain those types of rules. This is just how CSS modules work, you shouldn’t put Tailwind’s base styles in a module, the two concepts are just not compatible. It’s like trying to wash your dirty laundry in the microwave 😄 |
Edit I found out how to do it :) This branch contains the basic setup: Basically, I had NOT to import the css inside the lib, but in the apps/website and apps/webapp respecitvely. Original: Thank you for your quick reply adam! Can you tell me what the solution is to have a shared component lib / module with tailwindcss? |
@adamwathan I had the same error message when re-building a project today (5 Jan). The same repo was successfully building on 1 Jan, and there were no changes made to my SCSS modules or imports in that time. Locking the Tailwind version to 3.09 or below worked (build succeeded). Seems there was an issue with v3.0.10, still present in 3.0.11. It'll be tricly to make a minimal reproducible repo. But the *.module.scss files that were being mentioned in the error messages had no offensive imports or selectors in them - commenting out the entire file led to whack-a-mole where another file would get mentioned. An example file is below (the imported file is purely a set of constant declarations):
I would guess there is an issue with either imports or the @apply directive. I guess caused by #6580 or #6875 |
What version of Tailwind CSS are you using?
3.0.7
What build tool (or framework if it abstracts the build tool) are you using?
"next": "12.0.7",
"postcss": "^8.4.5",
"@nrwl/next": "13.4.1",
"autoprefixer": "^10.4.0",
What version of Node.js are you using?
v16.13.1
What browser are you using?
Chrome
What operating system are you using?
macOS
Reproduction URL
https://github.com/DanielSoCra/test-nx
Describe your issue
I am setting up a monorepo with nx to have a component library shared accross a website built with NextJs and a traditional CSR React.js App.
So far, the React App is working fine with the shared library.
The Nextjs app however throws the following error:
The shared-ui.module.css only has the following content:
Please refer to the provided Link and repo for all detailed configurations of tailwind.
I already searched and tried a few things, but nothing worked.
The text was updated successfully, but these errors were encountered: