typestyle / csx

Utility functions for TypeStyle
https://typestyle.github.io
MIT License
102 stars 14 forks source link

Does csx have plans to support calc() ? #32

Closed minodisk closed 7 years ago

minodisk commented 7 years ago

Like this:

1.

style({
  width: calc(`${percent(50)} - ${px(100)}`),
})

or

2.

style({
  width: calc(percent(50) - px(100)),
})

2 is probably impossible. Because the JavaScript runtime will calculate.

notoriousb1t commented 7 years ago

As you said, 2 is impossible because you can't overload JavaScript operators, but there should be no issue adding calc() as in 1.

notoriousb1t commented 7 years ago

This has been released with v8.3.0 along with some other updates

minodisk commented 7 years ago

Thanks for your replying. I'm trying v8.3.0 and calc(exp: string): string seems to work :sushi: