less / less/less.js

Lessc to provide preserve comments option

Open
#4,269 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug feature request
Dominant language
JavaScript
Stars
17k
Forks
3.4k
Avg merge
7h 42m
Merged PRs (30d)
26

Description

lessc should provide an option for comments to be preserved. Currently it preserves block comments and removes inline or // comments.

To reproduce:

// Main comment
/** comment with block **/
body {
  width: 100%; // inline comment
}

Current behavior:

/** comment with block **/
body {
  width: 100%;
}

Expected behavior:

/** Main comment **/
/** comment with block **/
body {
  width: 100%; /** inline comment **/
}

Environment information:

  • less version: v4.2.0
  • nodejs version: v18.18.0
  • operating system: macos

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 at the lessc command-line entry point and trace how comments are currently handled for the reproduction shown in the issue. Add a preserve-comments option whose output retains the line and inline comments, then verify the expected CSS behavior against the supplied example.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs
Domain
cli, compilers
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.