[csswg-drafts] [css-contain-3] Style feature parsing should disallow !important (#9986)

anttijk has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-contain-3] Style feature parsing should disallow !important ==
The text says

> The syntax of a <style-feature> is either the same as for a valid declaration [CSS-SYNTAX-3], a supported CSS property, or a <custom-property-name>.

and a valid declaration allows !important so I supposed it is allowed. There are even WPT subtests for it (in https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/container-queries/at-container-parsing.html and https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/container-queries/custom-property-style-queries.html).

Using !import here is useless and confusing though so should not be allowed. 

It would probably be better to define the syntax in terms of a property name and an optional <declaration-value> instead, analogous to normal container queries. This will also easily expand to allowing range syntax for registered custom properties.

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


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 21 February 2024 15:52:27 UTC