我想在旧的代码库中包含新的SASS。如果已经编写了新的样式,我该如何避免泄漏新样式。
e.g。
.box
width: 100%
// ...
.tab
display: inline-block
&:active
font-weight: bold
// Many more rules
到
.sandbox
.box
width: 100%
// ...
.tab
display: inline-block
&:active
font-weight: bold
// .many .more .rules
这将超过许多规则。
所以旧代码库中的新html代码段将具有
<div class="sandbox">
<div class="box">
<!-- Content here -->
</div>
或者 - 是否有更简单的方法来避免css代码泄漏?
答案 0 :(得分:3)
答案显而易见:
.sandbox {
@import "foo";
}