- From: Bert Bos <bert@w3.org>
- Date: Mon, 22 Jan 2001 15:36:15 +0100 (MET)
- To: <www-style@w3.org>
Manos M. Batsis writes: > Some time ago, i tried to start a thread on what i called "css > templates". I there something like this under consideration? It is a different style of programming. It is mentioned every once in a while, but there isn't anything concrete being designed. (And I don't think there should be, either.) > The idea is very simple and intents to save css authors from the > grouping nightmare, while it would be a means for clearer and > reusable code. To avoid repeating rules, CSS provides grouping of selectors and @import. Both of them, I think, are more direct than defining templates. Indirection is often powerful, but still I'd like to avoid it as long as possible. > For example: use a class as a template > <style> > /* Define a class to be used as a template:*/ > > ..template1{ > border:2px solid red; > height:100%; > } > > /*use the template in a class:*/ > > table{ > template: .template1; > border-color:blue; > } > > /*as you can see above, border blue should prevail over the templates suggestion*/ > > /*One thing that would be great is the ability to use templates from other stylesheets:*/ > > ..linkbox{ > template: .template1 url( styles/templates.css ); > border-color:blue; > } > > </style> I would use grouping instead: /* Set the common style */ table, p.special, div.other, blockquote.foo { border: 2px solid red; height: 100% } ... /* Override the common style for individual elements */ table { border-color: blue } 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 Monday, 22 January 2001 09:36:21 UTC