W3C home > Mailing lists > Public > public-css-archive@w3.org > April 2019

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

From: Valtteri Laitinen via GitHub <sysbot+gh@w3.org>
Date: Sun, 28 Apr 2019 13:08:35 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-487377826-1556456914-sysbot+gh@w3.org>
I think `el.style['--my-prop']` should be supported if possible. It’s syntactically nicer and more consistent: we tend to use `el.style.color` and not `.getPropertyValue('color')` or `.setProperty('color', 'red')`.

```js
el.style['--scale'] = 3;
el.style['--scale']; // "3"

// vs.

el.style.setProperty('--scale', 3);
el.style.getPropertyValue('--scale'); // "3"
```

-- 
GitHub Notification of comment by valtlai
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/1316#issuecomment-487377826 using your GitHub account
Received on Sunday, 28 April 2019 13:08:37 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 19 October 2021 01:31:07 UTC