相关疑难解决方法(0)

如何扩展具有动态形成选择器的类/ mixin

如何扩展使用&combinator动态形成的Less类?

较少产生预期输出:

.hello-world {
  color: red;
}

.foo {
  &:extend(.hello-world);
  font-size: 20px;
}
Run Code Online (Sandbox Code Playgroud)

预期的CSS输出:

.hello-world,
.foo {
  color: red;
}
.foo {
  font-size: 20px;
}
Run Code Online (Sandbox Code Playgroud)

Less不会产生预期的输出:

.hello {
  &-world {
    color: red;
  }
}

.foo {
  &:extend(.hello-world);
  font-size: 20px;
}
Run Code Online (Sandbox Code Playgroud)

意外的CSS输出:

.hello-world {
  color: red;
}
.foo {
  font-size: 20px;
}
Run Code Online (Sandbox Code Playgroud)

css less less-mixins

4
推荐指数
1
解决办法
741
查看次数

标签 统计

css ×1

less ×1

less-mixins ×1