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
But what if we need to customize set of properties. It is possible but providing all of them by parameters. In common it would be useful to pass ruleset.
.placeholder (@ruleset) {
&::-webkit-input-placeholder { /* expand @ruleset it here */ }
}
The text was updated successfully, but these errors were encountered:
What you ask for is not currently possible. There is an open issue on similar topic #965 , feel free to add your opinions or +1 there.
However, there is a possible workaround: Each less mixin sees its caller scope. E.g. following will work
// This mixins requires ruleset to be defined in callers scope
.placeholder () {
&::-webkit-input-placeholder {
// use ruleset - it is supposed to be defined in caller
.ruleset();
}
}
// usage example
#use-place{
// ruleset defined in caller
.ruleset(){
color: red;
}
// call the mixin
.placeholder();
}
Is there any way to pass rulesets to mixins (in common, save rulesets in variables, makin them first-class citizens)?
For instance, I want to customize color of placeholder:
But what if we need to customize set of properties. It is possible but providing all of them by parameters. In common it would be useful to pass ruleset.
The text was updated successfully, but these errors were encountered: