8000 [css-conditional-3] Are there issues with !important in @supports? (Is the grammar wrong?) · Issue #5559 · w3c/csswg-drafts · GitHub
[go: up one dir, main page]

Skip to content

[css-conditional-3] Are there issues with !important in @supports? (Is the grammar wrong?) #5559

@svgeesus

Description

@svgeesus

@SimonSapin [wrote on www-style in 2013](

Le 30/04/2013 07:44, John Daggett a écrit :

I've updated the CSS3 Fonts draft based on Simon's feedback.

AFAICT, the point of <descriptor_declaration> is to not have the
production for !important. You could, like @supports, refer to
defined in the Core Grammar instead.
Does @supports specifically ban the production? I don't see
the language in there for that. It's a relatively minor point but I
added the production to be clear that '!important' has no function in
@font-face rules (there have been issues brought up in the past in
relation to this).

I just assumed that because @supports defines explicitly
by referring to Chapter 4:

declaration : property S* ':' S* value;

rather than Appendix G:

declaration
: property ':' S* expr prio?
;

But I was wrong. !important is allowed and has no effect. This is
specified in section 6, just before section 6.1:

A trailing ‘!important’ on a declaration being tested is allowed,
though it won't change the validity of the declaration.

For example, the following rule is valid:

@supports (display: flexbox !important) {
// ...
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0