Arbitrary variants with commas in them #756
Unanswered
ben-rogerson
asked this question in
General
Replies: 1 comment
-
A workaround for some situations with multiple selectors is to use |
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
-
When you use an arbitrary variant with a comma, tailwind only styles with the first selector > check this demo
As of Twin v3, the classes you write are converted to tailwind compatible classes (eg: unwrapping variant groups, encoding custom values, replacing theme values etc) before being supplied to tailwind to perform matches.
I don't think this conversion should be silent in twin, so I've made twin throw a helpful error instead.
Also, the reason we can use commas within a single arbitrary variant is because twin pre-encodes the commas before the matches - A trick that only works when there isn't additional variants on the class.
Beta Was this translation helpful? Give feedback.
All reactions