You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Addition to LessJS
Lets use $buttons as an example. Its primarily $modules
$buttons{
#btn
}
.btn{
}
$button-sml{
}
$button-med{
}
$button-lar{
}
}
How it all works!?
When ever it finds "$buttons{}" block in the code, it ignores the whole block, if it is not explicitly called.
if we import $buttons, we can use any syntax to import for example:
module $buttons;
It gets all the content of the block as well as the sub block contents. In our example code, #btn,.btn as well as sub-modules $button-sml, $button-med, $button-lar.
if we import sub module in our code, like:
module $buttons.$button-sml;
It gets al the content of the block i.e. #btn, .btn and also only $buttons.$button-sml block content
The text was updated successfully, but these errors were encountered:
Please use backticks to format your code.
If I understand it right this feature already exists in LESS: "parametric namespace" (which essentially is just a parametric mixin containing another mixins), for example:
Basically, a combination of parametric and non-parametric mixins, their nesting and expand/unlock order can be used to create virtually any "namespace/module" system one can imagine (see also this Q&A).
There're a few (relatively minor) issues with "parametric namespaces" though: #996, #1316, #1525.
Addition to LessJS
Lets use $buttons as an example. Its primarily $modules
$buttons{
#btn
}
.btn{
}
$button-sml{
}
$button-med{
}
$button-lar{
}
}
How it all works!?
When ever it finds "$buttons{}" block in the code, it ignores the whole block, if it is not explicitly called.
if we import $buttons, we can use any syntax to import for example:
module $buttons;
It gets all the content of the block as well as the sub block contents. In our example code, #btn,.btn as well as sub-modules $button-sml, $button-med, $button-lar.
if we import sub module in our code, like:
module $buttons.$button-sml;
It gets al the content of the block i.e. #btn, .btn and also only $buttons.$button-sml block content
The text was updated successfully, but these errors were encountered: