3
如何動態調用mixin?不需要動態調用mixin
用例可能會產生一個風格指南:
// The mixin which should be called
.typography-xs(){
font-family: Arial;
font-size: 16px;
line-height: 22px;
}
// The mixin which tries to call typography-xs
.typography-demo(@typographyName, @mixinName) {
@{typographyName} {
&:before{content: '@{typographyName}';}
// Calling the mixin dynamically
@mixinName();
}
}
// Example call of .typograhpy-demo
.typography-demo(xs, typography-xs);
就是這樣一個動態調用可能在所有用更少的CSS?
哦,酷,看起來夠好ty! :) – jantimon