Re: New CSS variables syntax in latest WebKit

On Jul 25, 2008, at 12:32 PM, David Hyatt wrote:

> No, they don't work in @media blocks.  At the moment variables must  
> be defined at the top of a stylesheet (just after the @imports). As  
> with the @import rule, variables rules support media queries built  
> in, e.g.,
>
> @define for print { ... }
> @variables print { ... }
>
> instead of
>
> @media print { @define { ... } }
>
> If we want variables to work inside @media blocks, we'd basically  
> have to relax the restriction that variables rules must be at the  
> start of the stylesheet.  (There is no implementation hurdle to  
> doing so... this basically just comes down to syntactic preference.)

David, thank you for giving this to us to play with. As for the  
restriction you mention, I don't see any real downside to relaxing  
that. Maybe others do, and can comment on that. If it only meant that  
variables could not be used until after they are defined in the serial  
reading of the CSS, I could live with that (which would make them into  
de facto constants, I think).

Received on Saturday, 26 July 2008 05:25:36 UTC