less / less/less.js

String interpolation, list and !important keyword

Open
#2,374 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

I noticed something odd about string interpolation and lists:

.test-list {
  content: "@{variable}" !important;
  @variable: This is !important;
}

compiles into:

.test-list {
  content: "This is" !important;
}

I would expect it to be:

.test-list {
  content: "This is !important" !important;
}

I think it is just a minor issue, because following works correctly:

.test-string {
  content: "@{variable}" !important;
  @variable: "This is !important";
}

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 two interpolation examples from the issue and compare the compiled output with the expected CSS. The work is done when a list-valued variable preserves “!important” inside the interpolated string while the declaration’s own “!important” remains intact, without changing the existing quoted-string behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
css
Domain
frontend
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.