Replies: 1 comment
-
Ah interesting and good catch — definitely would say this is a bug, we should generate that CSS even if the class in |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm not sure that this is a bug per-se, so I wanted to bring it up in a discussion first. If you have a rule in a layer, or plugin, that includes a
:not(.class-name)
, it will not add it to the output ifclass-name
is not found in the content. Once you addclass-name
it will recognize it, add it, and continue keeping it throughout that build (but once you stop the watcher and re-start it will revert back).You can see an example here: https://play.tailwindcss.com/fSaAQLAJ2i
In that playground, you'll see that the div's background is not
magenta
as you might expect, but if you addclass-name
to the class attribute, and then remove it, it will turnmagenta
.Adding
safelist: ['class-name']
to the config will work around this issue, but is this unintuitive? Is it a bug?Beta Was this translation helpful? Give feedback.
All reactions