passing "default" to useStyles variantMaps #213
Closed
jwfwessels
started this conversation in
General
Replies: 1 comment 1 reply
-
Hey @jwfwessels ! “Default” is a reserved word and means “no value for variant.” What you’re trying to achieve is to name your variant “default” and actually pass the name of the variant. It was intentionally excluded in the TypeScript type and supported in the core of Unistyles. Changing this mechanism would be a breaking change, and I’m against it. You can simply name your variant differently, like “base” or “regular” and it will work as expected. I hope you understand! |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I wanted to ask about this as I found the behavior a bit unexpected (I did double check the documentation).
We extensively use variants and breakpoints in our design system which we are building using Unistyles (thanks for a great library!)
But we have had to resort to a pattern like this all over the place because variantsMap doesn't accept default as a valid value.
Is it feasible to extend the API to allow for the string 'default'?
Beta Was this translation helpful? Give feedback.
All reactions