Deduplicate CSS variables created from color tokens #2558
Replies: 2 comments 4 replies
-
I see your point, but what if your semantic tokens now uses a condition (CSS selector/at-rule) ? instead, this seems like a good opportunity to make a user-land PostCSS plugin that does that |
Beta Was this translation helpful? Give feedback.
-
Not sure I follow the logic with the at-rule. Like, the variables just reference values, they can be used anywhere (in an at-rule or otherwise)? Actually, I thourht this would be the default behavior of panda, and main benefit of referencing global tokens: semantic tokens would all reference the same value (not that they would make their own reference, to the same reference of the value). But as you say, should be easy to handle that with a plugin. I'll see if I can figure out how to that. |
Beta Was this translation helpful? Give feedback.
-
Description
Currently, a new CSS variable is created for each semantic color token that references a global color token. For example:
Instead of creating this additional layer of CSS variables, it would be more efficient and reduce bundle size a bit if semantic tokens could use the same CSS variable for the global token directly.
Problem Statement/Justification
(As mentioned above) it would be more efficient and reduce bundle size a bit if semantic tokens could use the same CSS variable for the global token directly.
Proposed Solution or API
This affects internal implementation. I haven't looked into the source yet too see what change would be required...
Alternatives
No response
Additional Information
No response
Beta Was this translation helpful? Give feedback.
All reactions