sass default為什么寫在后面
1 回答

慕標琳琳
TA貢獻1830條經驗 獲得超9個贊
sass的默認變量僅需要在值后面加上!default
Sass的默認變量一般是用來設置默認值,然后根據需求來覆蓋的,覆蓋的方式很簡單,只需要在默認變量之前重新聲明下變量即可。
比如:
$baseLineHeight : 2;
$baseLineHeight : 1.5 !default;
body {
line-height : $baseLineHeight;
}
編譯后結果就是:
body {
line-height : 2;
}
- 1 回答
- 0 關注
- 630 瀏覽
添加回答
舉報
0/150
提交
取消