Can @variant
work instead of @custom-variant
? Is this the expected result?
#18976
Answered
by
rozsazoltan
rozsazoltan
asked this question in
Help
-
Can
<div class="
dark size-32
not-dark:bg-red-500
dark:bg-green-500
stronger-dark:bg-amber-500
">...</div> @variant dark {
&:where(.dark, .dark *) {
@slot;
}
@media (prefers-color-scheme: dark) {
&:where(.system, .system *) {
@slot;
}
}
}
@variant not-dark {
&:not(:where(.dark, .dark *)) {
@media not (prefers-color-scheme: dark) {
@slot;
}
&:not(:where(.system, .system *)) {
@slot;
}
}
}
@variant stronger-dark {
&&:where(.dark, .dark *) {
@slot;
}
} |
Beta Was this translation helpful? Give feedback.
Answered by
rozsazoltan
Sep 22, 2025
Replies: 1 comment
-
Yeah:
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
rozsazoltan
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yeah:
tailwindcss/packages/tailwindcss/src/at-import.test.ts
Lines 590 to 620 in 6c30d5e