sass基础语法
sass基础语法 !default 表示默认值 + 拼接字符串 #{ } 识别为变量名 demo.scss $width:300px; $height:300px; $color:#e03434; $baseWidth:200px; $baseWidth:100px !default; .div1{ width:$width; height:$height; background-color:$color; } .div2{ width:$baseWidth; height:$baseWidth; background-color:$color; } demo.css .div1 { width: 300px; height: 300px; background-color: #e03434; } .div2 { width: 200px; height: 200px; background-color: #e03434; } 变量作用域 内部变量只能在内部使用,否则会报错 demo.scss $width: 300px; $color: #ffe932; .div1 { height: $width; $widthInner: 100px; width: $widthInner; } .div2 { width: $width; } demo.css .div1 { height