less / less/less.js

Comments misplaced

Open
#3,511 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature request low priority up-for-grabs
Dominant language
JavaScript
Stars
17k
Forks
3.4k
Avg merge
7h 42m
Merged PRs (30d)
26

Description

Less.js Version: 3.11.1

/** a */
.modal {
  /** b */
  &-header {
    font-size: 12px;
  }
  /** c */
  &-title {
    font-size: 12px;
  }

Output:

/** a */
.modal {
  font-size: 12px;
  /** b */
  /** c */
}
.modal-header {
  font-size: 12px;
}
.modal-title {
  font-size: 12px;
}

I think it should output:

/** a */
.modal {
  font-size: 12px;
}
/** b */
.modal-header {
  font-size: 12px;
}
/** c */
.modal-title {
  font-size: 12px;
}

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 Less.js 3.11.1 example from the issue and compare its generated CSS with the expected output. Trace the compiler's handling of comments around nested selectors; done means comments b and c appear immediately before .modal-header and .modal-title rather than inside .modal.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.