Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
boris-petrov opened this issue Apr 10, 2024 · 2 comments
Open
Labels
bug Something isn't working

Comments

@boris-petrov
Copy link
Contributor

<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
Copy link
Owner

jelhan commented Apr 10, 2024

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

@jelhan jelhan added the bug Something isn't working label Apr 10, 2024
@boris-petrov
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants