-
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
Nested SCSS selectors breaking @apply
directive
#9742
Comments
This seems to generate the wrong CSS even without Sass or nesting at all, so just dropping this reproduction here since it might help us trace it down faster: https://play.tailwindcss.com/a12qnV4sVd?file=css Thanks for reporting! |
I was expecting this might be the same bug as this one: #9668 ...but it still seems to behave incorrectly even on our |
Actually it is generating better output in /* v3.2.1 */
.foo:not(.bar) {
--tw-bg-opacity: 1;
background-color: rgb(254 226 226 / var(--tw-bg-opacity));
background: red;
}
.foo.baz.bam:not(.bar) > {
--tw-bg-opacity: 1;
background-color: rgb(255 237 213 / var(--tw-bg-opacity));
}
.foo:not(.bar).baz > .bam {
background: orange;
}
/* Insiders */
.foo:not(.bar) {
--tw-bg-opacity: 1;
background-color: rgb(254 226 226 / var(--tw-bg-opacity));
background: red;
}
.foo.baz:not(.bar) > .bam {
--tw-bg-opacity: 1;
background-color: rgb(255 237 213 / var(--tw-bg-opacity));
}
.foo:not(.bar).baz > .bam {
background: orange;
} The last two rules should be able to be collapsed so will leave this open as a reminder to look at that, but the behavior should at least be correct in the insiders build. |
Here's a minimal reproduction for the lack of collapsing: https://play.tailwindcss.com/XtHxx2TRfT?file=css My guess is because we are always putting pseudo-classes at the end of any selector "group", which I think is technically necessary for pseudo-classes like |
Awesome, makes sense. Appreciate the quick response and investigation! What's the process for |
We'll tag a proper release probably on Monday! In the mean time can just |
Oh, beautiful, didn't check NPM. I was looking for a GitHub tag and only found a single outdated one 👍 |
Just tagged a real release for you too 👍 |
My man |
Yep, that did the trick! Much appreciated. Feel free to close (or rename) to address that other collapsing issue. Thanks!! |
What version of Tailwind CSS are you using?
v3.2.1
What build tool (or framework if it abstracts the build tool) are you using?
Laravel Mix v6.0.49
What version of Node.js are you using?
v16.18.0
What browser are you using?
N/A
What operating system are you using?
macOS Ventura
Reproduction URL
https://github.com/shengslogar/tailwind-scss-nesting-bug-report/blob/main/output.css#L469-L493
Describe your issue
Complex nested SCSS selectors seem to be breaking the
@apply
directive.Input:
Output:
Expected Output:
Thanks in advance! 🙏
The text was updated successfully, but these errors were encountered: