Re: [csswg-drafts] [cssom] should custom properties be exposed on computed style declarations? (#1316)

To confirm, the plan is that custom properties will be included in the iteration results of `getComputedStyle`  if the property has a value _other_ than the "empty initial value" for custom properties. 

This seems to be what Firefox is doing.  Including the properties in the iteration is consistent with how custom properties are treated in the `style` object for inline styles. (Test case, focusing just on custom properties and not on custom elements: https://codepen.io/AmeliaBR/full/JVXEzq)

I'm assuming this means that the computed style should also include any custom property that has an initial value because of `registerProperty`.

Firefox (and as far as I know, Safari) does _not_ currently support getting/setting custom properties using the named accessors (`style["--my-var"]`), so I'm guessing that is not part of the proposed edits at this time: you'd still need to use `getPropertyValue()` and `setProperty()` for those.



-- 
GitHub Notification of comment by AmeliaBR
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/1316#issuecomment-480090427 using your GitHub account

Received on Thursday, 4 April 2019 22:47:42 UTC