-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
!important gets deleted from build when applyComplexClasses is enabled #2362
Comments
Tried to quickly reproduce this in a test but Tailwind is preserving the test('you can still use important in nested selectors', () => {
const input = `
.swiper{
&-pagination {
bottom: -40px !important;
}
}
`
const expected = `
.swiper{
&-pagination {
bottom: -40px !important;
}
}
`
return run(input).then(result => {
expect(result.css).toMatchCss(expected)
expect(result.warnings().length).toBe(0)
})
}) Need a minimal reproduction I can clone down to troubleshoot any further if you don't mind. |
@adamwathan here you go https://github.com/AndrewBogdanovTSS/tw-complex-classes
The interesting thing is adding !important inside @apply will propagate it on all styles after it:
So it's not related to postcss-nested and turning off applyComplexClasses brings it back to normal behavior |
* Don't propogate apply !important option to non-apply rules Fixes #2362. * Update changelog
Fixed in v1.8.9 which is out now, thanks for reporting! |
The bug is fixed, thanks @adamwathan 👍 |
* Don't propogate apply !important option to non-apply rules Fixes #2362. * Update changelog
One thing I just noticed when trying out
applyComplexClasses
in v.1.8.6 is that all of my!important
statements are stripped out from the compiled code.I use PostCSS with the next build config:
than in my vue component I have
resulting code just doesn't contain that !important:
without
applyComplexClasses
!important is thereI tried to use
above tailwindcss in the config but that that just makes build fail
also wanted to mention that it's not connected with purgeCSS since it was off
The text was updated successfully, but these errors were encountered: