Re: [css-variables] and [css-colors]

On Sat, Jun 16, 2012 at 4:31 AM, François REMY
<fremycompany_pub@yahoo.fr> wrote:
> I have a small question about the interaction between the <color> type and
> [css-variables]. Are we allowed to use variables inside color notations (I’m
> using the notations of latest [css-variables] Editor’s draft here) ?
>
> {
>   $r: 100;     $g: 10;     $b: 1;     $a: 0.1;
>   background: rbga($r,$g,$b,$a);
> }

Yup, that works just fine.  The color functions are just plain,
ordinary functions, and there's already some examples in the spec
showing how you can use variables inside of functions.

> I think we should modify the way rbg() and rgba() are defined in CSS Colors
> Module Level 4 to be :
>
>   <color>   +=   “rbg(” <integer> “,” <integer> “,” <integer> “)”
>   <color>   +=   “rbga(” <integer> “,” <integer> “,” <integer> “,”
> <alphavalue> “)”
>
> This would make it clear you can use [css-variables] inside them, and you
> could also use calc() which would be very nice if you want my point of view,
> especially in conjunction with [css-variables].

I agree - they should be defined with a simple grammar, rather than
the prose description we have now. I'll make sure this happens when
someone starts editting Colors 4.

~TJ

Received on Saturday, 16 June 2012 14:38:59 UTC