-
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
Explore implementing @apply in terms of postcss-extend-rule #1044
Comments
Would it be possible to make this a priority? Currently it's pretty much limiting any sort of inheritance in Tailwind and pretty much renders responsive classes unusable :(
|
Hi, on this topic, I just made a postcss plugin to 'preprocess' @apply at-rules so that variants can be used - basically it just expands any variant-prefixed classes in @apply rules to an @apply rule of the unprefixed class/es nested in the appropriate selector. e.g. It handles all the provided Tailwind variants and has an option to specify additional custom variants and the selector that should be applied. Hope someone finds it useful! It's my first PostCSS plugin so please feel free to provide any suggestions/enhancements! |
Watch out right now postcss-extend-rule has some problems to be resolved: |
FYI @.adamwathan is working on this already: https://twitter.com/adamwathan/status/1293575524254732289 |
Can be closed as of https://github.com/tailwindlabs/tailwindcss/releases/tag/v1.7.0 😅 |
If I had known about this plugin when I created Tailwind, we probably wouldn't even have
@apply
and I would just be telling people to use this instead because it handles all of the annoying crap that@apply
doesn't handle yet beautifully, like applyinghover:bg-red-500
and stuff.There are probably some special things we'd need to do to get the shadow lookup stuff working but in general I wonder if I should explore reimplementing apply using this plugin under the hood. Opening this issue so I don't forget :)
The text was updated successfully, but these errors were encountered: