less / less/less.js

Variable interpolation not working for multiple classes in :not

Open
#3,408 3 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

  • div:not(.class-a, .class-b, .class-c){} is supported in less
  • div:not(.@{some-variale}-class) is also supported in less
    However:
  • div:not(.@{some-variale}-class), .@{some-other-variale}-some-class)) is not supported and gives an error

e.g.

@ant-prefix: ant;
div:not(.@{ant-prefix}-radio-wrapper, .@{ant-prefix}-checkbox-wrapper){
  color: #ffffff;
}

Error message:

Module build failed (from ./node_modules/less-loader/dist/cjs.js):


  label:not(
    .@{ant-prefix}-radio-wrapper,
                              ^
Missing closing ')'

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

Reproduce the supplied Less selector with multiple interpolated variables inside :not, then trace the parser entry point handling that selector form. Done means the example compiles without the “Missing closing ')'” error and preserves all selector alternatives; no specific files or tests are named in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.