Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maximal config for utility classes? #778

Open
planktonic opened this issue May 10, 2023 · 0 comments
Open

Maximal config for utility classes? #778

planktonic opened this issue May 10, 2023 · 0 comments

Comments

@planktonic
Copy link
Member

When using bitstyles in a project, it is common to update some colors or the sizing scale. If this is only changing the values of colors and sizes, but keeping the naming the same, then this is not an issue. When the project is using a totally different sizing scale with different names for each size (e.g. 2xs instead of s2), or different names for each color (e.g. brand-primary instead of brand-1), this causes problems:

  • the values used for the utility classes no longer exist. The default config for .u-padding explicitly calls for each size by name. The colors used by the default config for .u-bg are also hardcoded
  • the names for those classes are also explicitly based on the names of the sizes, and are hardcoded in the config

This means that after changing those design token names, users of bitstyles have to override the config of lots of other modules to get a passing build.

We could provide a default config that iterates over each of the available design token scales in question (colors, sizes, font-sizes, line-heights, shadows…), and output classes using those values and those names.

This would increase the overall size of the CSS bundle generated, so let’s also start recommending something like purgeCSS?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant