bitcrowd / bitstyles

A complete design system, with base styles and components, built in Sass using CSS variables
https://bitcrowd.github.io/bitstyles
ISC License
16 stars 0 forks source link

Maximal config for utility classes? #778

Open planktonic opened 1 year ago

planktonic commented 1 year ago

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:

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?