lessphp icon indicating copy to clipboard operation
lessphp copied to clipboard

Bug on compile of variables as propertie

Open adamasantares opened this issue 10 years ago • 8 comments
trafficstars

Let's copy example form http://lesscss.org/features/#variables-feature-properties

@property: color;

.widget {
  @{property}: #0ee;
  background-@{property}: #999;
}

and on compile we have error:

parse error: failed at `@{property}: #0ee; ` .../mixins.less on line 8

I's very sad :(

adamasantares avatar Jan 20 '15 10:01 adamasantares

i found this bug too. hope fixed... sorry for my poor php skills...

qtisan avatar Feb 11 '15 23:02 qtisan

I have this issue too. It's not very important in my case, but I will maybe submit a PR if I have time.

remi-blaise avatar Feb 25 '15 12:02 remi-blaise

I have this error too. Will try to submit a PR.

jarnix avatar Feb 25 '15 14:02 jarnix

Ok. Please look if it's a bug (should work but doesn't work) or a simple lack of implementation (a forgetting).

remi-blaise avatar Feb 26 '15 11:02 remi-blaise

Lack of implementation. lessphp is somewhere in between less.js v1.3.3-1.4.0 while this feature is introduced in v1.6.0.

seven-phases-max avatar Feb 26 '15 12:02 seven-phases-max

I think I will try oyejorge/less.php, which seems up-to-date with lesscss. Both this issue and #593 works perfectly with it. I just need to adapt them to assetic.

remi-blaise avatar Feb 27 '15 10:02 remi-blaise

Zzortell, I tried this other lib and I got issues on math operations like * and / not getting compiled so be careful.

jarnix avatar Feb 27 '15 12:02 jarnix

Hum no it seems to work perfectly (use the demo). You need to be careful with math operations in lesscss too, but if you enclose operators with spaces and don't forget enclose the whole operation in case there were troubles about priorities I think it's ok.

Moreover by researching in fact this compiler it's not maintained anymore. leafo said :

I know I'm a little late to this party but as you've probably noticed I don't have much time for this project anymore.

People switched to oyejorge/less.php, and it was implemented in assetic and frameworks as the substitute of leafo/lessphp. leafo himself advise to use oyejorge/less.php.

oyejorge/less.php is (almost) up-to-date and

the code structure of less.php mirrors that of the official processor

After testing all work perfectly, so I definitively switch.

PS: According to people the benefit of leafo/lessphp is high speed, but it's bonus compared to compatibility and features.

PPS: In fact it's not so slow that people say ...

remi-blaise avatar Feb 27 '15 13:02 remi-blaise