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

Tab Atkins Jr.:
> On Thu, Sep 16, 2010 at 11:26 AM, Christoph Päper
> 
> @font-face does far more than a simple variable substitution;

Yes, but “more” means it does do variables (like other replies mentioned).

>>    name: MyRed;
>>    color: red; /* text */
>>    background: gradient("define me"), url(pattern.svg), url(pattern.png), red;
>>    border-left: hsla(0deg, 100%, 90%, 80%), rgba(90%, 5%, 5%, 80%), red;
> 
> Why are you mixing colors and images here?

That was just indended to show that you not necessarily will want to use a plain color for ‘…-color’ properties (in the future). I shouldn’t have used ‘background’ (which actually stands for ‘background-color’) there, because the ‘background’ property does accept image values already.

> Also, are you intending this to do fallback between the comma-separated values?

Yes, like the ‘src’ font descriptor does.

>> For better fallback, I believe this should work for static predefined color keywords (HTML/VGA and SVG/X11 names …).
>> 
>> This doesn’t fix the request for lengths, but it solves one problem very neatly with existing techniques.
> 
> A context-sensitive "color" seems pretty weird to me.  It's odd that attempting to use a particular "color" for color and background-color would give different results.

This is inspired by ‘@page’ which can differ for odd and even (or left and right) pages. It may seem odd at first and you would probably not use very different colors, but just change saturation for instance. I believe it could become very handy in some situations. It’s not a vital part of the proposal, though.

> I think this should just be addressed via a general Variables mechanism. 
> I don't see much reason to special-case color variables.

General variables cannot offer the fallback mechanism colors could do. Backwards compatibility is a major concern here.

John Daggett today effectively proposed variables for font-specific features:  <http://lists.w3.org/Archives/Public/www-style/2010Sep/0473.html>. Maybe custom at-rules for each type of variable are the most CSS-like way to do it. They should follow a common pattern, though: ‘@page’ and ‘@font-face’ already differ. (That’s why I wrote <http://lists.w3.org/Archives/Public/www-style/2010Sep/0331.html> this week and had three syntax variants in the initial post of this thread.)

Received on Friday, 17 September 2010 10:33:50 UTC