Re: author-defined color aliases

David Dorward wrote:
> The colours would have to be translated in to colours the browser can
> recognise at some stage. There are three places this could be done:
>
> (1) Once before the webserver reads the file
> (2) By the server every time it reads the file
> (3) By the client every time it reads the file (which means throwing
>     away backwards compatibility)
>
> Which is the more efficient?

I think this is the most important reason for not using the proposal: a
browser that doesn't support this could easily make a page illegible --
especially if all colours have been defined using aliases -- they all and up
black. And other properties using the alisases would break, too.

(1) is obviousely far superior, it saves processing time and general
efficiency and the problems of backward compatibility, whilst still
providing all the necessary functions. And lets face it, even without
good-quality editors that can do this preprocessing everyone know how to do
Find and Replace. You can also turn it back or change your mind easily - or
add a comment: color: #f0f /* highlight colour */.

If something _is_ to be used, and I don't think it is in the interests of
the users of the web as a whole, this would perhaps avoid the
backward-compatibility issues:

@propertygroup {
 name: mystylefortables;
 border: 1px solid #f12;
 color: #f6f;
 background-color: #002;
}

.someclass {
 propertygroup: mystylefortables;
}

Used carefully this would allow the CSS to degrade properly. It would also
allow something like this to be done using the @media rule:

@media screen {
  @propertygroup {
    name: anotherstylegroup;
    background-color: #003;
    color: #eef; /* which isn't usually made black when printed, so it
wouldn't show upwhen the background is removed*/
  }
}

@media print {
  @propertygroup {
    name: anotherstylegroup;
    background-color: #fff;
    color: #300;
  }
}

@propertygroup {
  name: anotherstylegroup;
  font-size: 1.2em;
  text-align: center;
}

.someclass {
 propertygroup: anotherstylegroup;
}

This gives a good cascade and a short definition, and avoids repeating
several attributes that are (in this case) the same for print and screen.

I'm still not sure that this is necessary, but I think what I've done would
be a good[1] implementation of the requests we keep getting.

[And I've only been on this list for a month or two and I've seen the
colour-aliases argument twice now;-]

HTH :-)

--
MAtt
[1] I Am Not A Computer Programmar (but I want to be one when I finish
school)

Received on Monday, 16 June 2003 17:02:50 UTC