是否可以通过递增或递减来重新定义 SASS 中的数字属性?考虑这样的事情:
h1 {
font-size: 10px;
}
h1.important {
font-size: += 10px;
}
我知道我可以通过定义一个变量来解决这个问题。有没有可能做到这一点?
最佳答案
不确定 +=
是否有效,但您可以使用基变量,然后在另一个类中添加到它。
$baseFontSize: 10px
h1
font-size: $baseFontSize
.border
font-size: $baseFontSize + 10px
关于css - SASS 中有类似 "+="的东西吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5116999/