Cheers,
Marc
Pei Y. Wei writes:
> I'm working on a stylesheet library that will hopefully be useful for
> all W3 browsers. A prototype is implemented in viola, but before I
> get too far on this-- producing a more formal RFC and stand-alone
> library and testing code, I'd like to get people's impression on it.
>
> Particularly, any problem with the the syntax of the style description
> language?
>
> Here is a sample stylesheet:
>
> (HEAD,BODY fontSize=normal
> BGColor=white
> FGColor=black
> (H1 fontSize=largest
> BGColor=red
> FGColor=white)
> (H2 fontSize=large)
> (P)
> (A FGColor=red)
> (CMD,KBD,SCREEN,LISTING,EXAMPLE fontFamily=fixed)
> (BOLD,EMPH,STRONG fontWeight=bold)
> (I fontSlant=italic)
> (ADDRESS
> (P fontSlant=italic))
> (OL
> (LI numStyle=roman
> (LI numStyle=number
> (LI numStyle=alpha)
> )
> )
> )
> (FOOTNOTE fontSize=small
> (P)
> )
> )
>
> >From this stylesheet, you can derive the following information:
>
> * <P> inside of <HEAD> and <BODY> gets fontSize of "normal".
> * <P> inside of <ADDRESS> gets italic slant font.
> * <P> inside of <FOOTNOTE> gets a "small" font.
> * List items in first, second, and third levels are numbered differently.
> * Since <BOLD> and <STRONG> look the same, they are succintly lumpped
> together.
>
> Note that properties are inherited down the tree, unless overridden.
> So, the color information that is specifed at the top is used all over,
> except for <H1> which redefines its own colors.
>
> Having this inheritance behaviour also helps to keep the description
> short, as lots of information can be derived by the context in the
> tree structure.
>
> The lone "(P)"s are there to engage the respective <P> tags to be in
> those particular contexts.
>
> A document uses a <LINK REL="STYLE" HREF="URL_to_a_stylesheet">
> to associate to a stylesheet. It's an open question as to whether
> we should allow multiple stylesheets in a document, and where
> this link can be specified (once only, in the <HEAD>?).
>
>
> -Pei Pei Y. Wei
> O'Reilly & Associates