Returns the unit(s) associated with a number. Complex units are sorted in alphabetical order by numerator and denominator.css
該函數接受一個scss變量,返回該變量表達式的單位。複雜的表達式按照字母排序的順序進行排序。
複雜的單位是按字母順序排列的分子和分母排序。
Examples:函數
unit(100) => ""
unit(100px) => "px"
unit(3em) => "em"
unit(10px * 5em) => "empx"
unit(10px 5em / 30cm / 1rem) => "empx/cmrem"
Parameters:
$number (Sass::Script::Value::Number)
Returns:
(Sass::Script::Value::String) — The unit(s) of the number, as a quoted string
Raises:
(ArgumentError) — if $number isn't a number排序