less.js icon indicating copy to clipboard operation
less.js copied to clipboard

Documentation error. Please fix it.

Open Bahurtsev opened this issue 8 months ago • 1 comments

On this page: https://lesscss.org/features/#extend-feature-extend-all

This example does not work:

.bucket { color: blue; } @{variable}:extend(.bucket) {} @variable: .selector;

compiles to:

.bucket, .selector { color: blue; }

You need to write it like this:

.bucket { color: blue; } @{variable} { &:extend(.bucket); } @variable: .selector;

compiles to:

.bucket, .selector { color: blue; }

As I understand it, LESS treats interpolation as "late binding", so :extend() cannot be applied to a selector that has not yet been formed at the parsing stage.

Bahurtsev avatar Mar 20 '25 20:03 Bahurtsev