ndeet / plg_system_less

A Joomla! system plugin to compile .less files on the fly.
GNU Lesser General Public License v3.0
17 stars 13 forks source link

Fixed to work with bs V3 #20

Closed robwent closed 10 years ago

robwent commented 10 years ago

The current lessc.php throws errors with bs v3 mixins that don't contain default values.

The latest version fixes this.

ndeet commented 10 years ago

Hi robwent, thanks for your pull-request and sorry that I forgot to give you some feed back on the issue #19

I did not check for a while but the last time I checked lessphp 0.4.0 (or lessjs 1.4) was not compatible with bootstrap 2.3. This means all Joomla 2.5 and 3.2 installations will break with this change (see also issue #12). I want to avoid that as most people probably work with the base bootstrap version shipping with Joomla 3.2

Maybe we could make an option to choose between lessphp 0.3.x and 0.4.x. So that you can configure which version you want.

robwent commented 10 years ago

Ah, sorry I really should have checked that.

A switch to change versions would be a great idea. I should have time this week if you want me to putit in and send a new pull.

ndeet commented 10 years ago

Hi, if you have time and want to get this feature asap I would really appreciate it. (I'm busy this week so I'll have time next week at earliest)

robwent commented 10 years ago

I think this will probably need some testing https://github.com/robwent/plg_system_less

I added an option to site and admin to be able to select the version of lessc. The select is a folder list so new versions can be dropped in later without having to edit the xml.

The less.php file checks if we're in the admin or on the site and then uses the correct version (or defaults to 0.3.9).

Strange thing is that on some sites 0.4.0 works for me with both versions and others only bs3, plus lessc 0.4.0 only seems to be compatible up to bs 3.0.0 but this seems to be in their issue tracker so might just be a case of waiting for an update for it to work with 3.0.2 (which was working for me last week.......go figure).

OptimumTheme commented 10 years ago

Hi, This extension is just what I am looking for. Thank you so much. Is there any progress about Bootstrap3 compatibilty? Because currently can not compile less because of errors with bs v3 mixins. Thanks.

robwent commented 10 years ago

check the link above to the fork.I have it working with bootstrap 3. You have the option of which compiler to use.

OptimumTheme commented 10 years ago

I still have the same issue on my local computer with the fork. I chose lessc-0-4-0 but this error occurs:

lessphp error: parse error: failed at `&:extend(.clearfix all);

robwent commented 10 years ago

hmm, try changing the version or dropping the latest in the plugin folder and using that

OptimumTheme commented 10 years ago

Tried both versions and didn't work. Also deleted the 0.3.9 one from plugin and didn't work again. By the way I tried other solution of yours (http://www.robertwent.com/blog/joomla/92-adding-a-compile-less-button-to-a-joomla-3-2-template) and same error but this time in the admin panel.

robwent commented 10 years ago

Are you sure there are no errors in your less? Can you compile them locally with another tool without error? The error in the admin panel would be directly related to the code but that uses fof's compiler which is built for bootstrap 2 (I assume as it's based on what joomla uses)

OptimumTheme commented 10 years ago

I didn't try to compile with another tool but anyway I just try to compile default bootstrap.less (which contains imports) file. So there is no custom code in the less file, it's just Bootstrap core. So I think it's not about code.

robwent commented 10 years ago

Well compiling bs3 core works fine for me so there must be some other variable.