Theme should be able to selectively overwrite vars based on which is defined or not #245
Unanswered
olivierpascal
asked this question in
Q&A
Replies: 2 comments 4 replies
-
|
This is already fixed on |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Just to be sure that we are on the same page @nmn, I am not talking about the typing limitation that requires all group var to be overwritten in a theme (#188), but rather the way that the vars are overwritten (the entire var group is always overwritten even if only one var is set in theme). |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Is your feature request related to a problem? Please describe.
I would like to have an option to make
stylex.createTheme()to selectively overwrite vars, instead of overwriting all vars from the base var group.Here is my usecase:
A themeable Button, themed by a global theme, which could be selectively overridden by a variant theme (ie. Rounded Button, Filled Button, Outlined Button, Elevated Button, ...), which could be selectively overridden by a theme provided in props (ie. Blue Rounded Button).
Today it is not possible to do so, because each theme embed all base vars, so I cannot just create a variant with a different text color.
Also, it is not possible to just copy all the base var group because it depends of the global/variant theme used.
You may say that it does not comply with the stylex philosophy or, or that my usage is incorrect, but i would love to hear from you about this usecase. Thanks.
Beta Was this translation helpful? Give feedback.
All reactions