Extending the config for modifiers #74
Replies: 1 comment 2 replies
-
Assuming you are using this with Tailwind CSS, it will not work as expected as Tailwind does not allow dynamic classNames. https://tailwindcss.com/docs/content-configuration#dynamic-class-names. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, I found out about this library from the Next conf 2022 vid and find it really useful, so thanks.
I have an idea to extend the cva config to accept an optional
modifiers
object, that for each nested key-value pair, the key corresponds to a modifier and value infers the type ofvariants
.So for styles generated like this:
Invoking would result in:
I was initially just thinking of darkMode but could be used for any modifier. I have a branch of this working locally, any thoughts on this approach? Thanks again.
Beta Was this translation helpful? Give feedback.
All reactions