-
Does tailwind v4 allow the dark variant to work with custom classes? Consider this simple working example:
The above will apply a black background to the element, but if try to use a custom class, then it won't: custom css
How can i achieve this..?
|
Beta Was this translation helpful? Give feedback.
Answered by
wongjn
Jun 23, 2025
Replies: 1 comment 1 reply
-
Use @utility card-background {
@apply bg-black;
} |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
moshiur01
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use
@utility
so that Tailwind "knows" about the class name and thus can apply variants to it: