leafo / lessphp

LESS compiler written in PHP
http://leafo.net/lessphp
Other
2.2k stars 529 forks source link

Parse error with bootsrap v3.3.4 #598

Open CsFender opened 9 years ago

CsFender commented 9 years ago

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

in mixins/grid.less on line 11

lweel commented 9 years ago

Same problem here. While parsing the BASE 2 framework. (https://github.com/matthewhartman/base)

Fatal Error: parse error: failed at &:extend(.font-bold); } web/less/base/_global.less on line 23

dleffler commented 9 years ago

I'm pretty sure that lessphp does NOT support 'extend' (which is needed to compile bootstrap v3) Look at the older issues...you might try less.php or iless.

tirithen commented 9 years ago

:+1:

glerner commented 9 years ago

Same error: Error making CSS files: parse error: failed at &:extend(.clearfix all); /MYFOLDER/less/bootstrap/mixins/grid.less on line 11

glerner commented 9 years ago

Even if you aren't going to update to support LESS :extend, catch the Exception so it doesn't crash PHP, okay?

throwError('LESS :extend not supported, ignoring this code');

PHP Fatal error: Uncaught exception 'Exception' with message 'parse error: failed at &:extend(.clearfix all); /PATH/public_html/SUBDIR/wp-content/themes/THEME/less/bootstrap/mixins/grid.less on line 11' in /PATH/public_html/SUBDIR/wp-content/plugins/assetsminify/vendor/leafo/lessphp/lessc.inc.php:3460 Stack trace:

0 /PATH/public_html/SUBDIR/wp-content/plugins/assetsminify/vendor/leafo/lessphp/lessc.inc.php(2273): lessc_parser->throwError()

1 /PATH/public_html/SUBDIR/wp-content/plugins/assetsminify/vendor/leafo/lessphp/lessc.inc.php(121): lessc_parser->parse('// Grid system?...')

2 /PATH/public_html/SUBDIR/wp-content/plugins/assetsminify/vendor/leafo/lessphp/lessc.inc.php(753): lessc->tryImport(Array, Object(stdClass), Object(stdClass))

3 /PATH/public_html/SUBDIR/wp-content/plugins/assetsminify/vendor/leafo/lessphp/lessc.inc.php(162): lessc->compileProp(Array, Object(stdClass), Object(stdClass))

4 /PATH/public_html/wp in /PATH/public_html/SUBDIR/wp-content/plugins/assetsminify/vendor/leafo/lessphp/lessc.inc.php on line 3460

glerner commented 9 years ago

https://github.com/oyejorge/less.php has section on replacing leafo lessc.inc.php with oyejorge lessc.inc.php and lib/ folder from oyejorge's less.php-master.zip

require "less/lessc.inc.php"; $less = new lessc; /* addImportDir seems to have no effect at all */ /* $less->addImportDir(array('less/','less/bootstrap/',__DIR__.'/', __DIR__.'/less/', __DIR__.'/less/bootstrap/')); */ try { /* use underscore underscore DIR underscore underscore */ $less->compileFile(__DIR__."/less/style.less", "/style.css"); } catch (exception $e) { echo '<p>Error making CSS files: ' . $e->getMessage() .'</p>'; }

andrtechno commented 9 years ago

+++ bootsrap v3.3.5 lessphp 0.5.0 parse error: failed at `&:extend(.clearfix all);

pafnuty commented 9 years ago

@andrtechno use https://github.com/oyejorge/less.php because this repo it seems died

andrtechno commented 9 years ago

nice thx