-
Notifications
You must be signed in to change notification settings - Fork 6.8k
feat(coercion): add utility for coercing CSS values #10654
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
Conversation
src/cdk/coercion/css-property.ts
Outdated
| */ | ||
|
|
||
| /** Coerces a value to a string that can be assigned as a CSS property. */ | ||
| export function coerceCssProperty(value: any): string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we either need to make it work with different units and call the function coerceCssUnitValue or it can stay just pixels and be coerceCssPixelValue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather keep it to pixels so we don't have to keep up with the different units. Changed the naming and we can reconsider if somebody requests it.
Also TIL that CSS has frequency units: https://developer.mozilla.org/en-US/docs/Web/CSS/frequency
Moves some duplicated logic for coercing CSS values under `cdk/coercion` and replaces the usages.
d1834df to
594327f
Compare
jelbourn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Moves some duplicated logic for coercing CSS values under `cdk/coercion` and replaces the usages.
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Moves some duplicated logic for coercing CSS values under
cdk/coercionand replaces the usages.