less / less/less.js

Extend of extend all

Open
#1,667 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Extend all will extend selectors generated by normal extend, however normal extend ignores selectors generated by extend all. Was that intentional?

I do not care one way or the other, I just need to know whether it is a bug or a feature.

Normal extend ignores selectors generated by extend all:

ruleset:last {
  property: value;
}

full:extend(ruleset:first) {}
:first:extend(:last all) {}

compiles into:

ruleset:last,
ruleset:first {
  property: value;
}

Extend all will extend selectors generated by normal extend:

ruleset:last {
  property: value;
}

full:first:extend(ruleset:last) {}
:nth-child(3n):extend(:first all) {}

compiles into:

ruleset:last,
full:first,
full:nth-child(3n) {
  property: value;
}

If it is a bug, then it is related to #1641 .

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 by reproducing the two selector examples from issue #1667 and compare how normal extend and extend all process generated selectors. Read the related issue #1641, then determine whether the asymmetric behavior is intentional or needs a consistent change; done means the behavior is decided and documented or corrected with matching results.

Written by the indexing model from the issue text.

Assessment

Tech stack
css, javascript
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.