-
Notifications
You must be signed in to change notification settings - Fork 13
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
Examples citing CSS.px API are incorrect #12
Comments
Good point. This explainer is in terms of potential things that CSS could expose, based on general input from @tabatkins, but with my own interpretation. Tab, since this isn't what CSS.px ended up doing, do you have a different idea for a fully realistic example? |
Then it doesn't represent the easing of an actual developer burden, or a measurable improvement to any existing practice. I think that practitioners would prefer if the language worked towards improving the existing landscape, instead of padding proposals with hypothetical future APIs. |
This is a response to a feature request from a leader of the CSSWG, @tabatkins. I think he could give you some more context here about the motivation with respect to CSS, but I was largely going from his blog posts in https://www.xanthir.com/b4UD0 and conversations with him that branched off from that. |
There's no reason for (I was originally assuming that it would just pass the numeric argument to the function, in which case it works automatically; the fact that it needs to pass a more complex argument to accommodate use-cases like BigInt is fine, it just means we'll need to extend the CSS side of the API in the future.) So it should still be considered to be easing a developer burden; (Possibly more likely would be us exposing a set of |
The explainer prose in CSS Typed Object Model, which references Numeric Factory Functions ignores that
CSS.px
(and friends) don't actually accept an object argument.According to this proposal's semantics,
3_px
desugars to_px(Object.freeze({number: 3, string: "3"}))
, but_px
(CSS.px
) doesn't know what to do withObject.freeze({number: 3, string: "3"})
, because it's expecting a number, ie.3
. As a result of this misrepresentation, the given example doesn't represent an actual use case burden to be eased by this proposal.The text was updated successfully, but these errors were encountered: