Skip to content

fix:(issue#4397): container query variable names#4398

Merged
matthew-dean merged 1 commit intoless:masterfrom
puckowski:master_fix_issue4397
Mar 8, 2026
Merged

fix:(issue#4397): container query variable names#4398
matthew-dean merged 1 commit intoless:masterfrom
puckowski:master_fix_issue4397

Conversation

@puckowski
Copy link
Copy Markdown
Contributor

What:

@varfoo: foo;
@threshold: 400px;
@container @varfoo (min-width: @threshold) {
    #sticky-child {
      font-size: 75%;
    }
}

Why:

Current behavior results in:

/* trailing space after the variable gets removed
    => 'foo' handled as a function
    => fail */
@container foo(min-width: 1024px){
    /* ... */
}

which is incorrect.

With the fix the output becomes:

/* space chars preserved */
@container foo (min-width: 1024px){
    /* ... */
}

Checklist:

  • Documentation
  • Added/updated unit tests
  • Code complete

* Fix for issue less#4397 container query with variable names like
  @container @foo () {}.
@dosubot dosubot Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Jan 25, 2026
@iChenLei
Copy link
Copy Markdown
Member

iChenLei commented Mar 6, 2026

Cool

@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Mar 8, 2026
@matthew-dean matthew-dean merged commit c625197 into less:master Mar 8, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants