作用域SCSS变量我有一组调色板不同的主题,像这样:用于更换主题皮肤
$primary: red;
$secondary: blue;
.theme-2 { $primary: green; $secondary: yellow; }
//..
//some random scss file that has typography class names
.cool-text { color: $primary; }
是否有可能使它所以,无论应用于容器类的名称用来定义的变量调色板颜色它?
例:
<div class="theme-2">
<p class="cool-text"> cool </p> // should be green
</div>
<p class="cool-text"> cool </p> //should be red
修改了代码snippet..please让我们知道什么工作默认红色..我们也可以从你所取得的成果中学到一些东西 – Geeky