Re: User constant declarations in style sheets

> I was wondering if it would be possible to implement the 
> declaration of constants and/or variables at the head of 
> each external and internal style sheet.

This is regularly proposed and rejected.  At least you have
made the scope of the identifiers clear (single file).
Basically, with file scope, the right place to do this is in the
authoring tool, so that the resolved variables are sent over
the wire.  This also has the advantage of backwards 
compatibility.

> 
> Eg. for positioning div blocks, instead of having to hard 
> code the top: and left: property value in each rule 
> declaration, what about something like this:

Have you tried listing multiple selectors against one rule; that is
the standard CSS way of handling this.  Remember that you don't need
to give all the rules for an object in one place.

Also remember that you can have multiple class names on an element,
so, if your styling bears some resemblance to following function, you
may well be able to avoid repetition by having general and specific
classes (e.g. menu and navigation).

Incidentally, you shouldn't have classes called top_logo, as you are
putting assumptions about the presentation into the structural part
of the document.  (px units are also generally undesirable, because 
the page can become unusable when users override font sizes.)

Received on Sunday, 24 April 2005 07:06:10 UTC