Issue with Panda CSS Generating Extra Tokens #2557
-
DescriptionHello, hope you're doing well. Could you please provide more context regarding the extra tokens generated by Panda CSS? Specifically, examples such as colors, sizes, and others would be helpful. The tool ideally should only generate the tokens that are explicitly used. Link to Reproduction. Steps to reproduce
JS FrameworkReact TS Panda CSS Version0.38.0 BrowserNo response Operating System
Additional InformationNo response |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
you can use a postcss plugin to achieve that like this one note that by doing so, you will not be able to use |
Beta Was this translation helpful? Give feedback.
you can use a postcss plugin to achieve that like this one
https://github.com/astahmer/pandabox/blob/main/packages/postcss-plugins/src/remove-unused-css-vars.ts
note that by doing so, you will not be able to use
token(xxx)
wherexxx
is a token path (leading to a CSS var) that wasn't explicitly used in your app code (from theinclude
ofpanda.config.ts
), as the postcss plugin only looks at the generated CSS and removes any CSS variable not referenced in some CSS rule