jelhan / ember-style-modifier

{{style}} element modifier for ember.js
MIT License
36 stars 12 forks source link

Types allow numbers to be passed but at runtime it doesn't work #248

Open boris-petrov opened 6 months ago

boris-petrov commented 6 months ago
<div {{style scale=1}}></div>

This compiles fine (as PropertiesHyphen from csstype allows it) but at runtime it breaks. Not that big of an issue but would be nice to somehow fix. Not sure how though. Perhaps the best way would be to make the style modifier work with other values not just string. Not sure why it was done so. Otherwise the types from csstype should somehow be augmented which probably won't be simple and will be brittle.

jelhan commented 6 months ago

Maybe we should revisit #109 and convert the value to a string explicitly?

boris-petrov commented 6 months ago

The arguments you've given there are pretty compelling and I agree with them. But there are a few properties which are exceptional - scale for example - which don't require a unit. Perhaps only they could be made to work with other value types as well as strings. That would be best of both worlds - the types will be correct and the usability would be best for users - they could use numbers as well.