Re: [css4-color] @color-keyword Color Keywords

Please ignore my earlier mail, I hit the wrong keyboard shortcut.

Eli Morris-Heft:

> [1]. It seems like there was a lot of discussion but that it didn't go all that far.

Yeah, the WG (or at least vocal members thereof) seem to favor a one-fits-all variables / constants approach, almost as if this was the seventies when preprocessed untyped string substitution macros were the best thing you could hope for. Also, a unified spec will probably take a longer time and we already have type-dependent keywords (e.g. font resources).

> @color-keyword {
>    keyword: ochre;
>    color: hsl(6, 82%, 37%);
> }

I much prefer

  @color "ocher" {…}

> While I can see that this is almost exactly a proper subset of the use cases
> for CSS variables,

That is only so, if you expect it to remain on this basic level, i.e. string to <color> 1:1 mapping. In that case,

  @color ocher hsl(6deg, 82%, 37%);


  @colors {
    ocher: hsl(6deg, 82%, 37%);

would be expressive enough.

> instead of having to reproduce all the selectors for the whole site
> in a different file and override their colors, one can simply name the
> colors and swap out the CSS file that defines those colors.

That’s why I suggested overwriting existing color names, because otherwise you will have to duplicate almost every rule that includes a <color> (expressed as a keyword). 

> Whether or not the existing color keywords can be redefined is a matter for
> debate. On the one hand, there is potential for bad code there.

I do agree, though, that overwriting ‘darkred’ with a light blue will seem strange, at least to native English speakers. One alternative is to reuse (some of) the deprecated System Color keywords, i.e. make them have site-dependent instead of OS-dependent semantics, and maybe introduce some additional semantic color keywords, which would have some default color value and could be overwritten in stylesheets.

> [1]

Received on Monday, 13 December 2010 13:49:05 UTC