Skip to content

Error. Please correct it. #4328

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Bahurtsev opened this issue Mar 23, 2025 · 0 comments
Open

Error. Please correct it. #4328

Bahurtsev opened this issue Mar 23, 2025 · 0 comments
Labels

Comments

@Bahurtsev
Copy link

Bahurtsev commented Mar 23, 2025

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.

@Bahurtsev Bahurtsev added the bug label Mar 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant