RE: New W3C Note about suggested CSS extensions

Jelks Cabaniss writes:
 > > > > Some people find it more convenient to use grouping for other
 > > > > purposes, and use a symbolic constant instead. E.g.:
 > 
 > > > Why would using @define preclude grouping?  Why couldn't you say:
 > > >
 > > >         @define orange = #faa;         ...
 > > >         H1, H2, H3 {color: orange};
 > 
 > > It doesn't preclude that; it just doesn't require it.
 > >
 > > The idea is to only need a single editing change if you want to adjust
 > > that color in a stylesheet, and be sure of hitting all occurences. Also,
 > > to isolate possibly different uses of the same color (which would likely
 > > be bad design anyway, but could happen).
 > >
 > > Its a maintainability convenience.
 > 
 > Aha, thanks!  This is virtually identical to (and has the same purpose of) the
 > "named styles" suggestion, but is slightly more restrictive.  Could the above
 > concept be expanded to handle something like:
 > 
 > 	@define myTheme = "color: navy; background: #eee; border: 3px #ccc outset";
 > 	...
 > 	h3 { myTheme; font-size: 1.1em }
 > 	p.standout { myTheme; font-size: .8em }

I guess it could, or even:

    @define myTheme(x,y) = "color: $x; background: $y;"

The language can accommodate such constructs in theory, but I'm not
sure it will contribute to usability. There will be "power users" that
know how to put these features to good use, but I'm afraid many people
will be bewildered. It will also make it harder to write programs that
manipulate style sheets.

My preference is make CSS powerful in its stylistic capabilities, but
simple in its language. Separate tools for separate tasks: people that
would know how to use macros like those above are probably also
knowledgeable enough to apply external tools, such as cpp, m4, editor
macros, databases, server-side includes or scripts/programs of their
own making to maintain complex style sheets.


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

Received on Thursday, 31 December 1998 08:50:23 UTC