-
Notifications
You must be signed in to change notification settings - Fork 4.5k
@apply rule cannot pick up grouped utility css selector #7844
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
Comments
This comment was marked as spam.
This comment was marked as spam.
Hi wondering if someone can take a look at this issue? |
Hey! Thanks for the report! The rule with Regarding the issue you pointed out about Neither For example, the utility class .group:hover .group-hover\:bg-orange-100 {
--tw-bg-opacity: 1;
background-color: rgb(255 237 213 / var(--tw-bg-opacity))
} This is because we want to be able to add .group:hover .group-hover\:bg-orange-100,
.item-add:hover .group-hover\:bg-orange-100,
.item-remove:hover .group-hover\:bg-orange-100,
.item-edit:hover .group-hover\:bg-orange-100,
.even-more-selectors-here:hover .group-hover\:bg-orange-100 {
--tw-bg-opacity: 1;
background-color: rgb(255 237 213 / var(--tw-bg-opacity))
} And, since we can't know how your HTML is structured, we have to generate all of them. As such it's likely not feasible for projects that split styles across multiple files — for example in Vue SFCs — since every use of This could also significantly increase the size of the CSS because this would be necessary for every
By default there would be This is definitely a long winded explanation but hopefully that helps explain some of the reasons why |
What version of Tailwind CSS are you using?
2.2.19
What build tool (or framework if it abstracts the build tool) are you using?
postcss-cli 8.3.1
What version of Node.js are you using?
v16.13.2
What browser are you using?
Chrome
What operating system are you using?
MacOS
Reproduction URL
https://gist.github.com/ALexander4295502/6fef8dfb343bc94a970700715460d172
Describe your issue
I am using a grouped css selector in my utility
colors.css
file as shown in the gist above (grouped selectors arehtml.dark .dark\:v-dark-bg-backdrop-modal
and.v-dark-bg-backdrop-modal
)And in one of my component css file, I am applying one of the grouped selectors to my component
And after running postcss cli command the
html.dark my-modal
is disappeared in the output CSS file, but if I separate the grouped selectos as separate selectors as below:There won't be any issues. As I didn't find any note in https://tailwindcss.com/docs/functions-and-directives#apply saying that
@apply
cannot be used for grouped selector, hence I think this is a bug needs to be fixed.The text was updated successfully, but these errors were encountered: