Re: CSS Variables

On Tue, Feb 8, 2011 at 10:34 AM, Linss, Peter <peter.linss@hp.com> wrote:

> On Feb 7, 2011, at 8:39 PM, Alex Russell wrote:
>
> On Sun, Feb 6, 2011 at 4:36 AM, Peter Beverloo <peter@lvp-media.com>wrote:
> That was exactly the objection that motivated the current use of "$" in
> declaration.
>
>
>>  Therefore
>> I'd be in favor of the following:
>>
>> @var foo red;
>> bar {
>>    color: var(foo);
>> }
>>
>
> This was my preference at first, but I eventually changed my mind.
>
> After some experience with the "var()" syntax via a pre-processor, it
> eventually wound up littering our code everywhere with syntax that wasn't
> trivial to un-pack when looking at it. The final ")" can be a long way from
> the "var(" component, and it's just a whole lot to type and read.
>
>
> I don't understand that point, how far can a ')' be from the 'var('?
> There's only supposed to be a single ident in between... (and perhaps
> whitespace) I suppose you could put comments in between, but ok, don't do
> that.
>

It's longer to read and write, and just having ")" be the (variable)
distance of an indent away from the beginning "var(" makes it harder to read
to my eye.

Having tried writing and reading code from both styles, the "$" won easily,
but I don't expect you to believe me. Try it out for yourself = )

Received on Wednesday, 9 February 2011 20:01:22 UTC