-
Miscellaneous函數:if($condition,$if-true,$if-false)查看全部
-
Introspection函數: type-of($value):返回一個值的類型 unit($number):返回一個值的單位; unitless($number):判斷一個值是否帶有帶位 comparable($number-1, $number-2):判斷兩個值是否可以做加、減和合并查看全部
-
列表函數: length($list):返回一個列表的長度值; nth($list, $n):返回一個列表中指定的某個標簽值 join($list1, $list2, [$separator]):將兩個列給連接在一起,變成一個列表; append($list1, $val, [$separator]):將某個值放在列表的最后; zip($lists…):將幾個列表結合成一個多維的列表; index($list, $value):返回一個值在列表中的位置值。查看全部
-
數字函數: percentage($value):將一個不帶單位的數轉換成百分比值; round($value):將數值四舍五入,轉換成一個最接近的整數; ceil($value):將小數向上取整; floor($value):將小數向下取整; abs($value):返回一個數的絕對值; min($numbers…):找出幾個數值之間的最小值; max($numbers…):找出幾個數值之間的最大值; random(): 獲取隨機數查看全部
-
To-upper-case(); //函數將字符串小寫字母轉換成大寫字母 To-lower-case(); //函數將字符串大寫字母轉換成小寫字母查看全部
-
字符串函數: unquote($string):刪除字符串中的引號; quote($string):給字符串添加引號。查看全部
-
@while循環: 只要@while后面的表達式值為真就編譯查看全部
-
Sass的@for循環: @for $i from <start> through <end> //包括end @for $i from <start> to <end> //不包括end查看全部
-
@if & @else:根據條件來使用不同的樣式查看全部
-
截圖不公開筆記查看全部
-
through 表示包括 end 這個數,而 to 則不包括 end 這個數。查看全部
-
fdf查看全部
-
@warn @warn 和 @debug 功能類似,用來幫助我們更好的調試 Sass。如: @mixin adjust-location($x, $y) { @if unitless($x) { @warn "Assuming #{$x} to be in pixels"; $x: 1px * $x; } @if unitless($y) { @warn "Assuming #{$y} to be in pixels"; $y: 1px * $y; } position: relative; left: $x; top: $y; } @mixin adjust-location($x, $y) { @if unitless($x) {//unitless是內置函數,判斷數值是否有“單位” @warn "Assuming #{$x} to be in pixels"; $x: 1px * $x; } @if unitless($y) { @warn "Assuming #{$y} to be in pixels"; $y: 1px * $y; } position: relative; left: $x; top: $y; } .botton{ @include adjust-location(20px, 30); }查看全部
-
@debug @debug 在 Sass 中是用來調試的,當你的在 Sass 的源碼中使用了 @debug 指令之后,Sass 代碼在編譯出錯時,在命令終端會輸出你設置的提示 Bug: @debug 10em + 12em; 會輸出: Line 1 DEBUG: 22em查看全部
-
@at-root @at-root 從字面上解釋就是跳出根元素。當你選擇器嵌套多層之后,想讓某個選擇器跳出,此時就可以使用 @at-root。來看一個簡單的示例: .a { color: red; .b { color: orange; .c { color: yellow; @at-root .d { color: green; } } } } 編譯出來的CSS .a { color: red; } .a .b { color: orange; } .a .b .c { color: yellow; } .d { color: green; }查看全部
舉報
0/150
提交
取消