CSS grammar: a bit more structure.

CSS has a very flat structure, in several respects.  Here I should like to
propose a change in the language to counter that in one of these respects.

As CSS grows, there will be more and more features that take (the same)
composite value.
Up till now this has been solved by the use of hyphens:
font-size
border-top-width

If we were to introduce composite types, one might (knowing that "border"
had type "LINE") state:
p.boxed {border: (width: 10; color: brown);}

This would have several advantages:
(1) Visual grouping, which can be traced by intelligent editors
(2) Textually shorter specification
(3) More modular definition: if the definition of "LINE" changes, one
doesn't have to adapt all the definitions of the properties that take a line
as their value
(4) Enforced uniformity: all lines will automatically accept the same
specification unless explicit exceptions are stated.

Of course for a (long) while the hyphenated style should be accepted too, at
least for features from CSS 1 & 2

A slightly more extended hypothetical example for tooltips:
title has type TEXTAREA, which contains properties for a.o. background and
font:

p.titled {title: (background: (color: yellow;); font: (size: 8pt; weight:
thin;););}

Or, if people prefer to mention the type explicitly:

p.titled {title: (Textarea
                   background: (Background color: yellow;);
                   font: (Font size: 8pt; weight: thin;);
                  );
         }


Any reactions?


J. A. Durieux
software engineer

Baan Dimensions 
Solutions for the
Metals, Paper & Cable Industries
Tel.	: + 31 (0) 318  - 58 77 40        
Fax.	: + 31 (0) 318  - 58 77 48
Email	: BDurieux@baan.com
http://www.baandimensions.com

Received on Monday, 22 January 2001 09:36:47 UTC