2

I suppose this is a semantic question. What is the correct way to refer to the !important rule in CSS? w3 says that rules defined with this are 'important rules', but this doesn't give away the name of the modifier. In the same link it uses the terms token delimiter and keyword, but it seems like those terms are used to refer to the ! and important independently. This is a list of what I think it might be referred to as, but I'd like an authoritative source.

  • keyword
  • delimiter and keyword
  • modifer
  • rule
  • declaration

The world won't end if I don't resolve this, but inquiring minds must know!

smilebomb
  • 5,123
  • 8
  • 49
  • 81
  • 2
    On https://www.w3.org/TR/css-syntax-3/ `!important` is referred as a flag: “_...A declaration has a name, a value consisting of a list of component values, and an important flag which is initially unset..._” – Fabrizio Calderan Mar 22 '16 at 14:47
  • @fcalderan That appears to be it! Thanks! – smilebomb Mar 22 '16 at 14:57

1 Answers1

1

!important is a declaration, using a delimiter token "!" and keyword "important".

https://www.w3.org/TR/CSS2/cascade.html#important-rules

Hope it answers your query :)

edit: somewhat similar discussion in here: How do you read !important in CSS?

Community
  • 1
  • 1
Hazonko
  • 1,025
  • 1
  • 15
  • 30
  • You've misread that webpage. "!important" is not a declaration. Rather, some declarations are "!important". Adding "!important" to the end of a declaration sets the declaration’s important flag to true. https://www.w3.org/TR/css-syntax-3/ – balazer May 08 '22 at 04:56