CSS 2: priorities in cascading order

Following recent discussion on the WAI IG list and elsewhere, I spent a
few minutes this afternoon re-reading the section of the CSS 2 draft that
deals with cascading order. I think there is definitely a problem that
needs to be considered by this working group, resulting from the fact that
where two or more inconsistent declarations are made, each of them having
the same specificity, the author-supplied declaration overrides the
reader's default style sheet. Furthermore, if a declaration in the
reader's default style sheet is marked as important, any inconsistent
declaration in the author's style sheet which is likewise marked as
important will prevail. It has been pointed out to me that some authors
may tend to mark all of their colour and font declarations as important,
thereby defeating the reader's preferences. Obviously this has important
consequences for people with disabilities.

A second problem results from the definition of specificity. It was
mentioned some time ago on the interest group list that it is difficult to
design, for example, a "large font" style sheet, because more specific
declarations override those which are of greater generality. Thus if, for
instance, a second level heading with a particular class value <h2
class="abc"> is declared by the author to have a particular font, this
will override any of the reader's font declarations relating to <h2>
(unless the reader has defined an IMPORTANT style specifically for <h2

Perhaps what is required is a mechanism by which the reader can designate
certain properties as being (1) so important that they can not be modified
subsequently in the cascading process; and (2) inheritable in such a way
that they will not be modified by any declaration in the author's style
sheet which has greater specificity. This only applies to situations in
which there are two or more inconsistent declarations of the same

This entire issue is obviously of concern to the interest group, and
therefore it is desirable that the HC working group should develop a
position with respect to it.

I have previously outlined an alternative solution which addresses the
problem by requiring an exact match of media types in order for a style
sheet to participate in the cascade. That solution has its disadvantages,
as Daniel has pointed out. One approach might be to include a directive
which the reader could specify in her or his default style sheet,
requiring that no subsequent style sheet should participate in the cascade
unless it has a parameterised media type which exactly matches the
parameterised media type of the style sheet in which the declaration
occurs. Thus, a style sheet with media="screen enlarged" (my hypothetical
example) would, if it contained this declaration, not be modified in its
application by a subsequent style sheet with the less specific media type
of media="screen".

If the proposed declaration is not given, then a subsequent style sheet of
type media="screen" would participate in the cascade and, where
applicable, override the provisions of the style sheet of type
media="screen enlarged". This should take care of Daniel's example of a
style sheet with media="braille embossed 42" being modified by a later
style sheet of type media="braille".

Personally, I would prefer the first of the two solutions which have here
been outlined, namely the one which modifies the definition of the
!important declaration and its role in the cascading process.

Received on Wednesday, 17 December 1997 01:05:30 UTC