RE: CSS 2: priorities in cascading order

Why is there an !important option for the author in the first place?

If it were removed, so that only the declarations of the User could be 
!important, then many of the problems we are discussing would simply 
disappear.

However I can see a use for it. Where an organisation such as a 
University had a house style sheet, and a department had some additions, 
it would allow the University to declare things which were important, and 
things which were simply defaults for the house style.

On the other hand, I have been re-reading the CSS2 Working Draft. My 
thoughts about specificity don't seem to apply. All that is required 
(assuming the user can override the author) is that each element be 
specified. This may be over-ridden by the use of a 'new element' to get 
around the user's declarations, eg

Myrule { colour : red }

and somewhere in a page
<P><MYRULE>this is red</MYRULE> and this is whatever the para is supposed 
to be</P>

That is a bad way to use CSS, and depends on implementation, but it is 
within the rules. Back to the real concerns...

It comes down to rule 3 of the cascading order. If this were changed from

Sort by origin: the author's style sheets override the reader's style sheet
      which override the UA's default values. An imported style sheet has the
      same origin as the style sheet from which it is imported. 
to
Sort by origin: the user's style sheet overrides the author's style sheet
      which override the UA's default values. An imported style sheet has the
      same origin as the style sheet from which it is imported. 

then it seems all the problems would be solved. The use of a new keyword 
would mean CSS1 stylesheets would not be able to provide user control 
where desired - the change of the rules means that would be achieved 
transparently.

Charles McCathieNevile
Sunrise Research Laboratory
RMIT University

Received on Sunday, 28 December 1997 22:18:19 UTC