Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I'm getting the following error:
LESS error: parse error: failed at `&:extend(.clearfix all);` sites/portal/themes/sfdc_ei_bootstrap/less/grid.less on line 25
The code in question:
.container {
&:extend(.clearfix all);
...
}
It parses if I change it to
.container:extend(.clearfix all) {
...
}
Unfortunately, I've also got a bunch of selectors with
selector-name-here {
width: 100%;
&.centered { &:extend(.centered); }
}
and changing those to
selector-name-here {
width: 100%;
&.centered:extend(.centered);
}
doesn't work.
I've been googling for issues with lessphp and &:extend but haven't found anything helpful. Any ideas?
thanks,
SB
Comments
Comment #1
sunset_bill CreditAttribution: sunset_bill commentedThe issue looks more like lessphp hasn't caught up with less. &:extend is a feature that wasn't introduced in less until the current version (1.4)
Comment #2
ging74ru CreditAttribution: ging74ru commentedI have replaced recomended library with this one:
https://github.com/oyejorge/less.php
Now &:extend works fine and my theme is compatible with bootstrap v3.1.0.
Comment #3
attisanlike a charm! I do recommend using http://lessphp.gpeasy.com/ instead of http://leafo.net/lessphp/
Comment #4
pedrospNewcomer, and same here, new library should at least pointed as an alternative on the project page setup info.
Comment #5
NecroHill CreditAttribution: NecroHill commentedsame here, could you please advise how to replace http://lessphp.gpeasy.com/ with http://leafo.net/lessphp/ ?
Comment #6
lcampanis CreditAttribution: lcampanis commentedReplace the old library in libraries/lessphp with this one:
https://github.com/oyejorge/less.php#transitioning-from-leafolessphp
Comment #7
medhatayar CreditAttribution: medhatayar commented1. Open \sites\all\modules\contrib\less\less_demo\less_demo.info file
2.cut stylesheets[all][] = styles/less_demo.info.css.less and paste below less[sheets][] = styles/less_demo.drupal_add_css.css.less