W3C home > Mailing lists > Public > www-style@w3.org > December 2010

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

From: Christoph Päper <christoph.paeper@crissov.de>
Date: Mon, 13 Dec 2010 14:48:27 +0100
Message-Id: <E87E7954-3183-4CEF-B8FB-D8DB82B128E6@crissov.de>
To: www-style list <www-style@w3.org>
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%);

or

  @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] http://lists.w3.org/Archives/Public/www-style/2010Sep/0460.html
Received on Monday, 13 December 2010 13:49:05 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:35 GMT