W3C home > Mailing lists > Public > www-style@w3.org > June 2012

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

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Sat, 16 Jun 2012 07:38:10 -0700
Message-ID: <CAAWBYDDesLtfwApsQn8YNSof+d_4p7t1mSPoPD4j5f9p9AxunA@mail.gmail.com>
To: François REMY <fremycompany_pub@yahoo.fr>
Cc: CSS 3 W3C Group <www-style@w3.org>
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 GMT

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