[v4] - Styling according to data-attribute resolves in empty classes #15933
-
Hi, first of all sorry if this is a misunderstanding from myself or even if this is a duplicate of an already-created issue. Usually we use to have simple CSS classes like: However this does not seem to work anymore now, and I see the class being created under the Here is a very sample reproduction from tailwindplay https://play.tailwindcss.com/PdWsw8YsyC I used default example and simply added a ![]() Does anyone know if I need to "handle" this kind of CSS ? If so, did I miss this part in the upgrade guide ? Thanks a lot for reading me. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Hey! You just want to use |
Beta Was this translation helpful? Give feedback.
I see what you are trying to do. A variant inside
[]
means that it is an arbitrary variant that you create on the fly. E.g.:[&:hover]
. But you want a selector like[placement-bottom]
, if you just use that, then the following CSS is generated:But notice how the
:is(placement=bottom)
is wrong, this should be inside of[]
. So in your case, you want to use[[placement=bottom]]:bg-blue-500
where the outer[]
indicator "this is an arbitrary variant" and the inner[]
indicate the selector. This now generates: