unquote

unquote($string) Removes quotes from a string. If the string is already unquoted, this will return it unmodified. Examples: unquote("foo") => foo unquote(foo) => foo Parameters: $string (String) Returns: (String) Raises: (ArgumentError) — if $string isn’t a string

function_exists

function_exists($name) Check whether a function with the given name exists. Examples: function-exists(lighten) => true @function myfunc { @return "something"; } function-exists(myfunc) => true Parameters: name (String) — The name of the function to check. Returns: (Bool) — Whether the function is defined.

index

index($list, $value) Returns the position of a value within a list. If the value isn’t found, returns null instead. Note that unlike some languages, the first item in a Sass list is number 1, the second number 2, and so forth. This can return the position of a pair in a map as well. Examples: index(1px solid red, solid) => 2 index(1px solid red, dashed) => null index((width: 10px, height: 20px), (height 20px)) => 2 Parameters: $list (Base) $value (Base) Returns: (Number

map_get

map_get($map, $key) Returns the value in a map associated with the given key. If the map doesn’t have such a key, returns null. Examples: map-get(("foo": 1, "bar": 2), "foo") => 1 map-get(("foo": 1, "bar": 2), "bar") => 2 map-get(("foo": 1, "bar": 2), "baz") => null Parameters: $map (Map) $key (Base) Returns: (Base) — The value indexed by $key, or null if the map doesn’t contain the given key Raises: (ArgumentError) — if $map is not a map

hue

hue($color) Returns the hue component of a color. See the CSS3 HSL specification. Calculated from RGB where necessary via this algorithm. Parameters: $color (Color) Returns: (Number) — The hue component, between 0deg and 360deg Raises: (ArgumentError) — if $color isn’t a color

selector_append

selector_append($selectors...) Return a new selector with all selectors in $selectors appended one another as though they had been nested in the stylesheet as $selector1 { &$selector2 { ... } }. Examples: selector-append(".foo", ".bar", ".baz") => .foo.bar.baz selector-append(".a .foo", ".b .bar") => "a .foo.b .bar" selector-append(".foo", "-suffix") => ".foo-suffix" Returns A list of lists of strings representing the result of appending $selectors. This is in the same forma

floor

floor($number) Rounds a number down to the previous whole number. Examples: floor(10.4px) => 10px floor(10.6px) => 10px Parameters: $number (Number) Returns: (Number) Raises: (ArgumentError) — if $number isn’t a number

complement

complement($color) Returns the complement of a color. This is identical to adjust-hue(color, 180deg). Parameters: $color (Color) Returns: (Color) Raises: (ArgumentError) — if $color isn’t a color

round

round($number) Rounds a number to the nearest whole number. Examples: round(10.4px) => 10px round(10.6px) => 11px Parameters: $number (Number) Returns: (Number) Raises: (ArgumentError) — if $number isn’t a number

Functions

Functions SassScript defines some useful functions that are called using the normal CSS function syntax: p { color: hsl(0, 100%, 50%); } is compiled to: p { color: #ff0000; } See this page for a full list of available functions. Keyword Arguments Sass functions can also be called using explicit keyword arguments. The above example can also be written as: p { color: hsl($hue: 0, $saturation: 100%, $lightness: 50%); } While this is less concise, it can make the stylesheet easier to read. It