cssinjs / istf-spec

Interoperable Style Transfer Format [DRAFT]
247 stars 8 forks source link

Default units support #3

Closed kof closed 7 years ago

kof commented 7 years ago

For e.g. in react we can omit 'px' for many values.

geelen commented 7 years ago

Big 👎 from me. Most CSS values have no sensible default unit. Pixels are most commonly used but they're not "preferred".

kof commented 7 years ago

Most CSS values have no sensible default unit

So is there anything that stops us from defining sensible defaults? Btw. jss-default-unit defines different defaults for different props.

kof commented 7 years ago

The benefit of having it is

geelen commented 7 years ago

As in, the properties intrinsicly don't have sensible defaults. There's no reason to bless px over rem for margins or font-sizes, for instance. Line heights can be unitless. I've expanded a bit on this idea here: https://github.com/styled-components/styled-components/issues/825#issuecomment-303864178

kof commented 7 years ago

Alright then lets put this one on hold for now.

kof commented 7 years ago

I would argue that within one project there can be sensible defaults for default units, but, in the context of a cross-package standard there is no. Every package would need to define its default units , which is a bit too much overhead right now.