Re: Inline h*ll

On Thu, 20 Jan 2000, Braden N. McDaniel wrote:

>> It is the responsibility of the user and UA stylesheet authors to make 
>> sure that their generic stylesheets cannot cause clashes.
> That's backwards. *Only* the author is capable of ensuring that
> clashes do not occur, since the authors styles reside at the bottom of
> the cascade. The UA and user stylesheets are at the top of the
> cascade; and the cascade cannot be predicted.

The last thing in the cascade is actually the user!important stylesheet.

The cascade cannot be predicted, no. However, responsible authoring
can make stylesheets reasonably safe without forcing authors to not
use transparency and other cool effects.

This means:
   always giving color and background-color together,
   always giving display for all related table elements together,
   always specifying content and counter properties together,
   always giving font-style for elements _and their descendants_.

...where 'together' means on adjacent rules with the same specificity
and importance.

In the case of the _user_ stylesheet, one should furthermore never mix
transparency and colours (background:transparent with color:inherit is
ok, and background:rgb() with color:rgb() is ok, but not a
combination), and _never_ use transparent images.

The reason for this is that transparency results in the
'unpredictability' of which you speak, and so should be confined to a
single part of the cascade (UA, user, or author). By confining
transparency to author stylesheets, you give authors the most freedom.

Of course, if the _user_ wants to use transparency, then that's ok: it
just means that _all_ colours must be specified. Since the user knows
what UA is in use, this is possible:

   *, :before, :after, :first-line, :first-letter {
      /* reset colours to initial values */
      color: inherit ! important;
      background: transparent ! important;
      border-color: inherit ! important;
   }

Then 'color', 'background' and 'border-color' can be used safely in
the user stylesheet (with !important declarations each time).

This will completely override the author stylesheet's colours.

Similarly with 'display' and the box properties:
 
   *, :before, :after, :first-line, :first-letter {
      /* reset structure to initial values */
      display: inline ! important;
      margin: 0 ! important; 
      padding: 0 ! important;
      border-style: none ! important; 
      border-width: 0 ! important;
      /* plus any others I've forgotten */
   }

...then the user controls layout, and can use 'display', 'margin',
'padding', 'border' and those I've forgotten safely.

By doing this, you can control specific sets of properties (e.g.
fonts, colour, layout) and let the author control the rest.

If all the above are followed (and a few more that I haven't yet
worked out), then stylesheets won't clash. But in all the above cases,
the assumption is that the UA and the user are responsible for making
their stylesheets safe, and the author can assume that if his
stylesheets work with one set of UA and user stylesheets, his
documents will still be _readable_ with another set. (Although there
is a strong possibility that they will look different, of course.)

-- 
Ian Hickson                            ("`-''-/").___..--''"`-._   
http://www.bath.ac.uk/%7Epy8ieh/        `6_ 6  )   `-.  (     ).`-.__.`)
                                        (_Y_.)'  ._   )  `._ `. ``-..-' fL
Member, Mozilla Quality Assurance     _..`--'_..-_/  /--'_.' ,'
Browser Standards Compliance Team    (il).-''  (li).'  ((!.-'    

Received on Friday, 21 January 2000 07:25:54 UTC