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

Re: [css-variables] Using $foo as the syntax for variables

From: Anton Prowse <prowse@moonhenge.net>
Date: Sun, 27 May 2012 10:55:29 +0200
Message-ID: <4FC1EC01.4050301@moonhenge.net>
To: www-style@w3.org
CC: "Tab Atkins Jr." <jackalmage@gmail.com>, Pete Boere <pete@the-echoplex.net>
On 26/05/2012 21:14, Tab Atkins Jr. wrote:
> On Sat, May 26, 2012 at 12:09 PM, Pete Boere<pete@the-echoplex.net>  wrote:
>>  From the perspective of PHP (and perl or bash) scripters, dollars in CSS
>> would create everyday problems.
>>
>> Heredocs:
>>
>> print<<<CSS
>> <style>
>> p {
>> color: $bar;
>> }
>> </style>
>> CSS;

That doesn't seem like a very typical use of heredocs.  Much more 
common, I would have thought, would be assigning the value to a variable:

$foo = <<<EOD

EOD;

This is a widely-used approach.

> Instead, do:
>
> ?>
> <style>
> p {
> color: $bar;
> }
> </style>
> <?php
>
> Jumping into the HTML-output mode is good for outputting HTML.

This counter-argument doesn't apply to the case I describe above.

> Alternately, use a proper library for
> constructing and outputting HTML, rather than string concat.

This simply doesn't happen in practice.


I can't say that these conflicts with PHP would cause me to object to 
any variables proposal which utilizes '$', but they are certainly 
unfortunate.

Cheers,
Anton Prowse
http://dev.moonhenge.net
Received on Sunday, 27 May 2012 08:55:58 GMT

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