Replies: 1 comment 1 reply
-
I kinda did that as a panda plugin here (
|
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
-
On the JSX syntax, Panda CSS supports 3 different filters for the utilities on the
jsxStyleProps
config:From my understanding, the utilities are not only used for the JSX props, but it's how Panda knows the connection between a property and its allowed values.
When creating a Design System, we don't want to allow all the CSS properties to be customizable, usually we want only a set of them available for the consumers. The "All" is too permissive. At the same time, the "Minimal" is too restrictive, as it allows no prop customization and limits cases where you want to set direct values (as width, for example).
The alternative would be to eject from the default utilities, but they are really good and already links all the tokens to the correct values, if we add only the utilities we would like to expose, we would loose the token connection on properties as
color
, which usually is something you don't want to expose on a DS.My proposal is to be able to on the "All" approach to allow/block specific utilities from being accessible through JSX prop syntax, on the configuration level (for all components) and even on component level if needed:
Configuration object:
On a styled component:
With this flexibility, when creating the button, by default it will assume the values from the config include/exclude. If needed you can expose more utilities on a component based approach, all this without loosing the ability of using the same utility when creating the base for it.
Beta Was this translation helpful? Give feedback.
All reactions