Replies: 1 comment 2 replies
-
you can use |
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
Uh oh!
There was an error while loading. Please reload this page.
-
Description
The out of the box setup for Panda CSS includes both
@pandacss/preset-base
and@pandacss/preset-panda
which by default adds a large number of utilities and patterns to the config. These utilities and patterns are nice and useful but they can be a bit opinionated and cause bloat in projects where we want to control what is exposed by the generated styled system. The out-of-the-box setup should be more minimal.Problem Statement/Justification
Non-standard CSS properties (like
px
,mt
) via utilities should be opt-in so that developers can knowingly choose to use them.Also having as little utilities, patterns, conditions, etc in the out-of-the-box setup would help reduce the JS bundle size as well.
Proposed Solution or API
My proposed solution is that the
@pandacss/preset-base
preset would only contain utilities that simply enhance standard CSS properties likepadding
andmargin
with theme token values. All other utilities, patterns, conditions, etc. would be provided by other presets and they would have to be opt-in.The base preset could be split into multiple presets like:
@pandacss/preset-shorthands
@pandacss/preset-conditions
@pandacss/preset-patterns
Alternatives
It is possible to minimise the amount of baked-in utilities and patterns by adding
eject: true
to the config but this however will remove the utilities that simply map properties to theme tokens, such aspadding
,margin
, etc, so adding styles likecss({ padding: '$small' })
would not work anymore.We could remove the unwanted utilities from the preset with something like this:
and then pass those utilities to the config definition but that feels a bit hacky.
Additional Information
No response
Beta Was this translation helpful? Give feedback.
All reactions