@tzi opened this Issue on April 9th 2015 Member

Hi piwik team!

We currently use the leafo/lessphp library that is not active since a long time (16 commits in the last year).
We should perhaps consider migrate to oyejorge/less.php. It seems more up to date with the less.js version, have less bugs and is more active.

This could prevent issue like #6103 and could ease theming.

Cheers,
Thomas.

@diosmosis commented on April 9th 2015 Member

Just a note: We'd need to make sure WhiteLabel works with less.php; it uses some behavior of lessphp that may not be supported by less.php.

@tzi commented on April 10th 2015 Member

Sure, we have to be sure WhiteLabel works perfectly.

I think it will help us with the theming.
Because lessphp have a weird bug that messing with variable override.
But, it seems to be fixed with the v0.5.0!

Do you think to a specific behaviour that we needed, that could be missing in less.php?

Cheers,
Thomas.

@diosmosis commented on April 10th 2015 Member

Well, WhiteLabel might depend on that weird bug. It's been a while since I looked at the code, but I think it depends on an import being done before processing everything else, even if the import is at the end of the file. Or something like that. Whatever it was seemed like it would be considered a bug in other solutions. Anyway, it's just a note. Before merging a change with less.php we have to make sure the WhiteLabel build passes, at least on a branch.

@mnapoli commented on May 28th 2015 Member

On this topic, here is an issue that was created (#8004):

If I use &:extend i get parser error. Is it possible to use another parser or solve this problem please.

This is a big bug it seems, it can't even compile Bootstrap 3: https://github.com/leafo/lessphp/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+extend

@mnapoli commented on May 28th 2015 Member

Regarding WhiteLabel, there is this comment in the Generator class:

Note: We always have to generate two less files. One "theme.less" file that imports the actually generated less file containing all the variables (less_variables.less). As I found out the variables will be overwritten if we write them directly into the "theme.less" file as an imported less file would overwrite them although we define them at the very end.

We have this problem on master currently so I updated to v0.5.0 which fixes the problem (done in #8015, should be fixed soon). Given the bug, and the workaround that is used in WhiteLabel, it doesn't seem like it will break (i.e. the workaround is not necessary anymore, but it shouldn't break from my understanding).

But in any case we could definitely try moving to less.php (lessphp seems in a really sad state). And given the bug we are all talking about, maybe it won't be that hard because WhiteLabel shouldn't break (note the "shouldn't" ;) ).

@mattab commented on May 29th 2015 Owner

the workaround is not necessary anymore

since you upgraded the less.php to the latest and this fixes the bug, maybe we could remove this workaround from our codebase? (now that it's not needed)

maybe it won't be that hard because WhiteLabel shouldn't break (note the "shouldn't" ;) ).

btw we will check White Label works well in 2.14.0 in #8006

@diosmosis commented on May 29th 2015 Member

since you upgraded the less.php

small note: we use 'lessphp', not 'less.php'. just in case you are thinking about closing this issue ;)

Powered by GitHub Issue Mirror