- From: Tab Atkins Jr. via GitHub <sysbot+gh@w3.org>
- Date: Thu, 23 Aug 2018 20:44:33 +0000
- To: public-houdini-archive@w3.org
(I'm using `to()` here, rather than the method shape you suggested, because we need to resolve it into some specific unit. We don't have a type that represents a nebulous "length, in some unspecified unit" type, which is the only thing we could reasonably return from such a conversion function.) That said! I think we might want to allow something that, for example, keeps %s as they are while resolving the rest into a length as much as possible. This is useful for cases like `background-position`, where the % doesn't resolve into a length in a straightforward way. I think we can handle all the use-cases for this by just adding this options bag to `toSum()` as well; if a % doesn't trivially resolve into a length, then it can't be used in a `px / %` expression anyway, so requiring that it resolve into a sum should be fine. In other words, calling `len.toSum("px", "percent", {element:el})` should be able to *always* succeed, and will always return a `CSSMathSum` where the first element is a `CSS.px()` and the second is a `CSS.percent()`. -- GitHub Notification of comment by tabatkins Please view or discuss this issue at https://github.com/w3c/css-houdini-drafts/issues/798#issuecomment-415564954 using your GitHub account
Received on Thursday, 23 August 2018 20:44:34 UTC