Skip to content

[css-contain-3] Style feature parsing should disallow !important #9986

@anttijk

Description

@anttijk

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 suppose 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions