Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我们希望h1使用类似的 mixin 从 bootstrap 中继承
h1
.btn2{ .btn; }
而是想使用该h1元素:
.h1_replace{ h1; }
我不相信 less 支持这种类型的类继承。相反,您可能必须将 h1 样式重新定义为一个类并继承它。
.h1 { /* copy h1 style here */ } .h1_replace{ .h1; }
虽然如果你这样做,你可能只需要在整个代码中使用 .h1 类。
您可以使用扩展:
.h1_replace:extend(h1) {}
http://lesscss.org/features/#extend-feature