【发布时间】:2018-02-07 00:13:31
【问题描述】:
是否可以通过数据绑定更改 sass 变量?
示例:我想通过按钮更改变量的颜色。
我对除 Knockout.js 之外的其他解决方案持开放态度。
$color: red;
my_class {
background-color: $color;
height:20px
width:20px;
}
<button type="button" data-bind="css: { $color: 'green'}">Change to Green</button>
<div class="my_class"></div
【问题讨论】:
标签: javascript jquery html knockout.js sass