I'm getting a syntax error when attempting to reference a variable from a namespace in LESS:
#testns {
@my_color: #04ffff;
.me() {
color: blue;
}
}
.fun {
color: #testns[@my_color];
}
The mixin works fine if I do the following:
.fun {
#testns > .me();
}
But I'm not able to reference the variable from the namespace for some reason. I'm building these in Java using the asual library, and everything else is working perfectly.
This isn't how namespaces work. Namespaces allow you to declare local-scope variables to use in mixins (sort of like a CSS closure, ha!), and the mixins can be referenced from outside the namespace bundle. The variable inside the namespace are private, however, and cannot be referenced from outside the namespace.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With