glam icon indicating copy to clipboard operation
glam copied to clipboard

unitless properties

Open threepointone opened this issue 8 years ago • 3 comments

like react, the following should both 'work' without 'px -

let cls = css` font-size: 20 `
let cls = css` font-size: ${myVar} `

threepointone avatar May 05 '17 07:05 threepointone

as a counter argument - maybe it's good not to rely on the magic addition of px? at least it would be in line with how css works.

also in react px is only appended for numbers. if you pass in a string it doesn't get added.

(p.s. cool idea! i'll be watching this closely :-))

itsdouges avatar May 07 '17 23:05 itsdouges

I definitely prefer the addition, I'm not particularly interested in purity.

Aware of the second issue, have an idea to solve it.

threepointone avatar May 08 '17 01:05 threepointone

some further detail - because we use css vars, you can't directly concatenate 'px' when interpolating, like -

let cls = css` font-size: ${myVar}px `

the react-ish way is really nice, and backs glamor as well.

threepointone avatar May 09 '17 05:05 threepointone