Lessc to provide preserve comments option
Open
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:
lessversion:v4.2.0nodejsversion:v18.18.0operating system:macos
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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