W3 Note - item 28 - "@define orange = #faa;"

> > 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.

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

This is nearly an 'alias' vs 'scripting' solution ? And scripts have nothing 
to do within a css.

- If the purpose is to use symbolic constants, I would prefer a syntax 
such as "@alias orange = #ffaaaa;", or "@constant orange...". "Define" 
let you believe that you'll be able to define procedures in the future

- If the purpose is only to use _one_ value in an alias (people will 
soon be frustrated not to be able to use more values), best is to give 
people tricks, such as the use of comments and copy/paste : "/* #ffaaaa 
orange */" at the beginning of the style sheets, and when you want to 
change the color in red, add /* #ff0000 red */ and emacs the rest of 
the file, with C-c C-r #ffaaaa <CR> #ff0000 <CR>  !


I would prefer to examinate Daniel's idea :


daniel.glazman@der.edf.fr said:
>   @define edf-style(visit-card) {
> 	font-family : frutiger ;
> 	font-size : 8pt ;
> 	font-variant : small-caps ;
> 	text-align : center ;
> 	margin : 0.2cm 0cm
> 	}
>   ADDRESS { edf-style : visit-card } 
 

Problem 1 : edf-style has not to be a css keyword. 
Problem 2 : I still don't like @define


Why not having a new css keyword "bag" and write the following :

  @constant bag(edf-style-visit-card) {
	font-family : frutiger ;
	font-size : 8pt ;
	font-variant : small-caps ;
	text-align : center ;
	margin : 0.2cm 0cm
	}
  @constant bag(orange) {
        color : #ffaaaa;
        }
  ...
  HTML.slide P.identity { bag: edf-style-visit-card, orange ;
               position : absolute ;
               width : 5cm ; height : 2.7cm ;
               right : 0cm ; bottom : 0cm }
  SPAN.orange { bag: orange;
        }



	Ay.

Received on Monday, 4 January 1999 12:34:42 UTC