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

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 UTC