如何扩展使用 & 组合器动态形成的 Less 类?
Less 会产生预期的输出:
.hello-world {
color: red;
}
.foo {
&:extend(.hello-world);
font-size: 20px;
}
预期的 CSS 输出:
.hello-world,
.foo {
color: red;
}
.foo {
font-size: 20px;
}
Less 不会产生预期的输出:
.hello {
&-world {
color: red;
}
}
.foo {
&:extend(.hello-world);
font-size: 20px;
}
意外的 CSS 输出:
.hello-world {
color: red;
}
.foo {
font-size: 20px;
}