Skip to content

[css-typed-om] CSSNumericValue.to should take multiple type inputs #391

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

Closed
shans opened this issue Apr 18, 2017 · 3 comments
Closed

[css-typed-om] CSSNumericValue.to should take multiple type inputs #391

shans opened this issue Apr 18, 2017 · 3 comments
Assignees

Comments

@shans
Copy link
Contributor

shans commented Apr 18, 2017

... so you can "cast" a type to a calc expression - e.g. collapse a calc with inches, pixels and ems to a calc with just pixels and ems.

@tabatkins
Copy link
Member

Now that we have toSum(), do we want to instead move this functionality there? So that toSum() (no args), just collapses as far as possible, but toSum("px", "em") returns something that has specifically "px" and "em" keys.

@shans
Copy link
Contributor Author

shans commented May 23, 2017

This makes sense to me. I think this functionality is fairly specialist anyway, so it's OK for it to be slightly hidden away.

Note: we will need a constructor/factory function to convert sums back into values.

@tabatkins
Copy link
Member

Done. toSum() now, appropriately, returns a CSSMathSum object, so there's no need for an additional factory function to turn the result back into a CSSNumericValue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants