Closed kof closed 7 years ago
Big 👎 from me. Most CSS values have no sensible default unit. Pixels are most commonly used but they're not "preferred".
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.
The benefit of having it is
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
Alright then lets put this one on hold for now.
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.
For e.g. in react we can omit 'px' for many values.