This repository was archived by the owner on Apr 6, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 41
Custom "important" variant not working #92
Labels
Comments
Yeah this is a limitation of how variants have to work in the new engine, they are limited to the |
Ah okay gotcha - does that mean this would work instead? addVariant('important', ({ container }) => {
container.walkRules(rule => {
rule.selector = `.${e('important:')}${rule.selector.slice(1)}`
rule.walkDecls(decl => {
decl.important = true
})
})
}) EDIT: Just checked, it does work |
Might want to update https://tailwindcss.com/docs/plugins#complex-variants :) |
Why? That works in the regular Tailwind library, it's just the JIT project that has the limitation right now. Still in pre-release, lots left to do :) |
Oh fiddlesticks. I realized the issue I had with the documentation not working was due to not adding the variant name in tailwind config to extend the property I was using.
Signed,
a Silly goose
|
Added first class support for |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
This particular variant isn't working right now (0.1.2):
The expected classes (eg.
!bg-red
) aren't generated/kept when evaluating this kind of markup (<p class="!text-red">
)The text was updated successfully, but these errors were encountered: