[css-houdini-drafts] [css-typed-om] CSSNumericValue .to() function, wishful thinking (#876)

vidhill has just created a new issue for https://github.com/w3c/css-houdini-drafts:

== [css-typed-om] CSSNumericValue .to() function, wishful thinking ==
[CSSNumericValue](https://drafts.css-houdini.org/css-typed-om-1/#dom-cssnumericvalue-to), specifically the `to()` function.

I was playing about thought (hoped) the conversion methods would be able to convert REMs to pixels..

```javascript
CSS.rem(1).to('px') // doesn't work
```

I note the caveat; 
according to the [Google article](https://developers.google.com/web/updates/2018/03/cssom) it is limited to [Absolute length](https://developer.mozilla.org/en-US/docs/Web/CSS/length#Absolute_length_units)s

I can understand how converting something like `em`s to pixels wouldn't work because that would require the context of the dom node, as the size of one `em` depends on context...

But the `rem` unit specifically, is tied to the root element, so it should be possible.


Please view or discuss this issue at https://github.com/w3c/css-houdini-drafts/issues/876 using your GitHub account

Received on Friday, 12 April 2019 21:52:28 UTC