W3C home > Mailing lists > Public > www-style@w3.org > September 2001

@important rule

From: Bjoern Hoehrmann <derhoermi@gmx.net>
Date: Tue, 11 Sep 2001 02:41:05 +0200
To: www-style@w3.org
Cc: howcome@opera.com
Message-ID: <o5mqptcpbsrvnp1q4api9tpg5k7uhq7dmr@4ax.com>
Hi,

   CSS Level 2 changed the semantics of !important rules in user style
sheets to override concurring declarations in user agent and author
style sheets to give the user the last word in what he gets presented.
This is great but users still have to write the redundant !important
after each declaration to get what they want, e.g. ending up with

  h1 {
    font-family: Verdana !important;
    font-size: xx-large ! important;
    font-weight: 900 ! important;
    voice-family: female ! important;
    border: silver dashed thin !important;
    ...

This is neither readable nor feasible for users, therefore I propose a
new @important rule for the CSS Level 3 Cascade Module to group
!important declarations, thus making the example to something more
comfortable like

  @important {
    h1 {
      font-family: Verdana;
      font-size: xx-large;
      font-weight: 900;
      voice-family: female;
      border: silver dashed thin;
      ...
    }
    ...
  }

The prose for this new at-rule should just say that each declaration in
this block must be interpreted as it had an !important declarations.
Additional !important declarations shall be ignored.

I don't care too much about the syntax, but since at-rules cannot be
nested in CSS Level 2 (the generic syntax allows it, though) another
approach could be some statement like

  @important on;

and the corresponding

  @important off;

This would additionally avoid one level of nesting, but may be harder to
read/parse/whatever.

regards,
-- 
Björn Höhrmann { mailto:bjoern@hoehrmann.de } http://www.bjoernsworld.de
am Badedeich 7 } Telefon: +49(0)4667/981028 { http://bjoern.hoehrmann.de
25899 Dagebüll { PGP Pub. KeyID: 0xA4357E78 } http://www.learn.to/quote/
Received on Monday, 10 September 2001 20:42:15 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:10 GMT