【发布时间】:2013-07-05 22:42:00
【问题描述】:
我想在旧代码库中包含新的 SASS。考虑到已经编写的新样式,如何避免新样式泄漏。
例如
.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 sn-ps 会有
<div class="sandbox">
<div class="box">
<!-- Content here -->
</div>
或者 - 有没有更简单的方法来避免 css 代码泄漏?
【问题讨论】:
-
你有没有尝试过?您似乎了解嵌套的概念,因此解决方案应该是显而易见的。
标签: namespaces sass