jelhan / ember-style-modifier

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

improve typing of CSS styles using csstype package #216

Closed jelhan closed 9 months ago

jelhan commented 9 months ago

Improves the typing for CSS styles using the csstype package.

In case you are running into an issue that a valid CSS style is not allowed by the types, please update the indirect csstype dependency to a latest version. E.g. you could do so by regenerating the lockfile. If that does not help, the csstype package provides documentation how to deal with that situations: https://www.npmjs.com/package/csstype#what-should-i-do-when-i-get-type-errors

Thanks a lot to @boris-petrov for suggesting this via Discord.

boris-petrov commented 9 months ago

@jelhan thanks a lot for doing that! It's certainly more helpful. How about also adding the ability to use CSS variables - what I mentioned in Discord:

Partial<CSS.Properties> | Partial<CSS.PropertiesHyphen> | { readonly [key: `--${string}`]: string }
jelhan commented 9 months ago

@jelhan thanks a lot for doing that! It's certainly more helpful. How about also adding the ability to use CSS variables - what I mentioned in Discord:

Partial<CSS.Properties> | Partial<CSS.PropertiesHyphen> | { readonly [key: `--${string}`]: string }

Missed that this is needed in addition.to support CSS custom properties. And it seems we are missing test coverage for that use case as well. A PR fixing it is highly welcome.