Enable "inherits: false" for some CSS vars #715
philholden
started this conversation in
General
Replies: 1 comment 2 replies
-
This is a known issue. So far, I have put up #709 (which should land very soon), that removes all the variables that are currently set to A follow-up is planned where every variable that is created specifically for dynamic styles will be marked |
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
-
StyleX advises the sparing use of dynamic variables. For each CSS prop that has a dynamic potential a CSS var gets created in the style prop even if that style is never set. Our existing component library using Emotion has lots of dynamic style props (perhaps 20 for some components) however if we port this to StyleX this ends up generating inline styles for the props that are not used with the value set to initial:
It would be helpful to have a way to say to styleX for this dynamic property I want you to create a non inheritable variable. That way I would not need 20
--property: initial;
vars being set on style. My guess is it may yield some performance potential as a non inheritable var is less to reason about and less style props are being set. You may want the vars to be slightly namespaced:Beta Was this translation helpful? Give feedback.
All reactions