我需要在没有equation的情况下使用combine多个作用域,例如使用本机:
本地CSS:
.test
{
color: black;
}
.demo
{
color: black;
}和合并版本:
.test,
.demo
{
color: black;
} 但我需要以下几点:
@.test: .demo; // Something like that equation, all test classes equal demo class
.demo
{
color: black;
}如果不能用CSS,作为最后的手段,我可以使用LESS
发布于 2014-07-22 09:22:00
在较少的情况下,可以使用extend函数来实现这一点。
.demo
{
color: black;
}
.test:extend(.demo){}; /* extends the properties of the .demo */
/* .test:extend(.demo all){}; /* the all keyword would extend nested sub classes of .demo also */演示
发布于 2014-07-22 09:27:20
除了Harry的回答之外,您还可以这样做:
.demo
{
color: black;
}
.test {
@extend .demo;
}[样本]
https://stackoverflow.com/questions/24883301
复制相似问题