Skip to content

[v4] - Styling according to data-attribute resolves in empty classes #15933

Closed Answered by RobinMalfait
remy-poirier asked this question in Help
Discussion options

You must be logged in to vote

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:

.\[placement\=bottom\]\:bg-blue-500:is(placement=bottom) {
  background-color: var(--color-blue-500);
}

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:

.\[\[placement\=bottom\]\]\:bg-blue-500:is([placement=bottom]) {
  background-color: 

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@remy-poirier
Comment options

@RobinMalfait
Comment options

Answer selected by remy-poirier
@remy-poirier
Comment options

@RobinMalfait
Comment options

@remy-poirier
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants