-
So I have been pulling my hair out all morning trying to figure out why a custom class wasn't being applied in dark mode in an Astro project I am working on. Basically I have a rather complicated glass effect I want to apply in dark mode if a menu is active. If its light mode the class is much simpler and can be handled by tailwind utility classes. I thought it would be a simple case of doing something like this
and then conditionally applying it with the cn utility. But no matter what, After asking claude.ai it seems that custom classes aren't able to applied this way?! Has this always been the case? What would be the best practice for applying something like this? Just make a general It would be really nice to be able to implement my own custom styles with the dark prefix though. Is this possible? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You'd need to use the @utility my-glass {
…
} |
Beta Was this translation helpful? Give feedback.
You'd need to use the
@utility
directive like:@utility my-glass { … }