system-ui / theme-specification

A specification for defining theme objects & design tokens for use with UI components
https://system-ui.com/theme
531 stars 19 forks source link

Propose collapsing dimensions/lengths into `sizes` key #2

Closed jxnblk closed 5 years ago

jxnblk commented 5 years ago

A thought occurred to me the other day that it might make more sense to collapse width and height properties into a single field, similar to how space is currently treated. It seems like the same values could be reused for different properties. This is similar to something @ianstormtaylor proposed on twitter with lengths.

Possible, alternative names to consider:

It's worth noting that <length> has a specific meaning in CSS that is slightly different than the possible values here (e.g. percentages), which is part of the reason for using sizes in this PR

ianstormtaylor commented 5 years ago

sizes is a great word for it. Used it originally myself too, and had to switch for unimportant internal reasons, but was using sizes before that and liking it.

fk commented 5 years ago

+1 for sizes: I spontaneously picked dimensions recently during a minor "spring cleaning" binge for gatsbyjs.org, but in hindsight it feels a bit too "vague" next to space.

jxnblk commented 5 years ago

Merging this in because it seems like generally a good direction based on feedback