W3C home > Mailing lists > Public > public-css-archive@w3.org > November 2020

Re: [csswg-drafts] [css-conditional] Should CSS.supports() accept !important in the 2nd argument? (#5692)

From: Oriol Brufau via GitHub <sysbot+gh@w3.org>
Date: Wed, 04 Nov 2020 00:09:10 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-721440158-1604448550-sysbot+gh@w3.org>
Thinking more about this, basically `CSS.supports(property, value)` is useful if it tells you whether `element.style.setProperty(property, value)` will work. And `setProperty` doesn't allow mixing the value and the priority, you need a third argument for that.

So `CSS.supports("background", "green !important")` should be `false` because these don't work:
```js
element.style.background = "green !important";
element.style.setProperty("background", "green !important");
```

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


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Wednesday, 4 November 2020 00:09:13 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:42:22 UTC