less / less/less.js

Error. Please correct it.

Open
#4,328 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

On the page: https://lesscss.org/features/#mixins-feature-guarded-namespaces

Invalid code:

#sp_1 when (default()) {
#sp_2 when (default()) {
.mixin() when not(default()) { /* */ }
}
}

Namespaces in LESS cannot be "default" in the same sense as mixins. The default() function in LESS only works with mixins and their parameters, not with namespaces.

Namespaces (#sp_1, #sp_2) are not mixins. They are used to group mixins and variables, but do not participate in the default() logic.
when (default()) only applies to mixins. It checks whether the mixin was called with default parameters, or was not called at all.
There is no call to the mixin in your code. The only mixin .mixin() is inside namespaces, and it is never called.
Namespaces are logical groups, not executable code.

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

Open the guarded namespaces example at https://lesscss.org/features/#mixins-feature-guarded-namespaces and compare the shown default() usage with the surrounding explanation. Correct the example or its explanatory text so it does not present namespaces as participating in default() logic, then verify the rendered section no longer contains the invalid claim.

Written by the indexing model from the issue text.

Assessment

Tech stack
css
Domain
documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.