Re: XHTML+CSS single-source (multi-channel)

On Mon, Oct 03, 2005 at 03:05:13AM -0400, Matthew Raymond wrote:
> Bert Bos wrote:
> 
> > So instead of requiring multiple links of the form
> > 
> >     <link rel="alternate stylesheet" href="red.css" title="Extra red">
> >     <link rel="alternate stylesheet" href="r2.css" title="Technical">
> > 
> > a single link is enough and the other links are in CSS:
> > 
> >     @import url(red.css) "Extra red";
> >     @import url(r2.css) "Technical";
> 
>    Would browser be able to support nested styles in this case? Would
> this allow tree-like or multi-tier style selection?

They may be able to, but we currently don't plan to make that a
requirement. Viewing the styles as a tree structure is more something
that an editor might do. The minimum a browser has to do is allow the
user a choice from a flat list of styles. That list is constructed in
the following way:

  - All the TITLE attributes that can be found without parsing any
    style sheets, i.e., those of LINK and STYLE elements in the
    document.

  - All the titles that can be found on @import and @media inside
    style sheets that have to be parsed anyway, i.e., those that have
    no titles themselves. (In the HTML spec, those are called
    "persistent" styles.)

For example, if you have this link

    <link rel=stylesheet href=a.css title="Style A">

and a.css contains

    @import "b.css" "Style B"

then this "Style B" is not shown in the menu of styles and is never
loaded. (Unless, perhaps, you turn on "debugging" mode or something
like that, but that is not specified by CSS.)



Bert
-- 
  Bert Bos                                ( W 3 C ) http://www.w3.org/
  http://www.w3.org/people/bos                               W3C/ERCIM
  bert@w3.org                             2004 Rt des Lucioles / BP 93
  +33 (0)4 92 38 76 92            06902 Sophia Antipolis Cedex, France

Received on Monday, 3 October 2005 08:34:35 UTC