less / less/less.js

Complex DR definition works as at-rule

Open
#2,825 2 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

A variable definition with a value that ends with an unnamed ruleset, e.g.

@var: x {y: z};

is interpreted as an unknown at-rule, thus resulting in:

@var : x {
  y: z;
}

This is most likely a result of #2783. (Before #2783, such code resulted in a error, i.e. it's not a regression but more like an overlooked side-effect).
See also related https://github.com/less/less.js/issues/2270#issuecomment-61634539.

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 @var: x {y: z}; case and review the parsing change from #2783, along with the related discussion in #2270. Trace how variable definitions ending in unnamed rulesets are classified, then add regression coverage showing that the input is handled as a variable definition rather than emitted as an unknown at-rule.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.