less / less/less.js

"Selector Interpolation with Extend" possibly contains outdated info (doc states not supported, but works)

Open
#4,228 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
17k
Forks
3.4k
Avg merge
7h 42m
Merged PRs (30d)
26

Description

https://lesscss.org/features/#extend-feature-selector-interpolation-with-extend
The section opens with the example:

Selector with variable will not be matched:

@variable: .bucket;
@{variable} { // interpolated selector
  color: blue;
}
.some-class:extend(.bucket) {} // does nothing, no match is found

However, this does seem to work (at least since LESS v4.1.0):

@selector: e('.example');
@{selector} {  content: 'testing :extend ONTO interpolated selector';  }

.test-1:extend( @{selector} ) {  content: 'doesnt work, as expected';  }
.test-2:extend( .example ) {  content: 'does work, contrary to doc';  }

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked Selector Interpolation with Extend section and reproduce both examples using LESS v4.1.0 or the current version. Compare the documented behavior with the results, then update the section so its explanation and examples accurately describe interpolation and :extend; done means the documentation matches a verified test case.

Written by the indexing model from the issue text.

Assessment

Tech stack
css
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.