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

sunset_bill’s picture

Status: Active » Closed (works as designed)

The 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)

ging74ru’s picture

I 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.

attisan’s picture

Issue summary: View changes

like a charm! I do recommend using http://lessphp.gpeasy.com/ instead of http://leafo.net/lessphp/

pedrosp’s picture

Newcomer, and same here, new library should at least pointed as an alternative on the project page setup info.

NecroHill’s picture

same here, could you please advise how to replace http://lessphp.gpeasy.com/ with http://leafo.net/lessphp/ ?

lcampanis’s picture

Replace the old library in libraries/lessphp with this one:
https://github.com/oyejorge/less.php#transitioning-from-leafolessphp

medhatayar’s picture

1. 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