3
어떻게 믹스 인을 동적으로 호출합니까?덜 믹스를 동적으로 호출하십시오.
유스 케이스는 스타일 가이드를 생성 할 수 있습니다 :
// 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로 모두 같은 동적 호출 할 수 있습니까?
오, 멋지다. :) – jantimon