keywords

keywords($args) Returns the map of named arguments passed to a function or mixin that takes a variable argument list. The argument names are strings, and they do not contain the leading $. Examples: @mixin foo($args...) { @debug keywords($args); //=> (arg1: val, arg2: val) } @include foo($arg1: val, $arg2: val); Parameters: $args (ArgList) Returns: (Map) Raises: (ArgumentError) — if $args isn’t a variable argument list

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

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

str_index

str_index($string, $substring) Returns the index of the first occurrence of $substring in $string. If there is no such occurrence, returns null. Note that unlike some languages, the first character in a Sass string is number 1, the second number 2, and so forth. Examples: str-index(abcd, a) => 1 str-index(abcd, ab) => 1 str-index(abcd, X) => null str-index(abcd, c) => 3 Parameters: $string (String) $substring (String) Returns: (Number, Null) Raises: (ArgumentErr

Operations

Operations All types support equality operations (== and !=). In addition, each type has its own operations that it has special support for. Number Operations SassScript supports the standard arithmetic operations on numbers (addition +, subtraction -, multiplication *, division /, and modulo %). Sass math functions preserve units during arithmetic operations. This means that, just like in real life, you cannot work on numbers with incompatible units (such as adding a number with px and em) and

@at-root

@at-root The @at-root directive causes one or more rules to be emitted at the root of the document, rather than being nested beneath their parent selectors. It can either be used with a single inline selector: .parent { ... @at-root .child { ... } } Which would produce: .parent { ... } .child { ... } Or it can be used with a block containing multiple selectors: .parent { ... @at-root { .child1 { ... } .child2 { ... } } .step-child { ... } } Which would output the following:

& in sassScript

& in SassScript Just like when it’s used in selectors, & in SassScript refers to the current parent selector. It’s a comma-separated list of space-separated lists. For example: .foo.bar .baz.bang, .bip.qux { $selector: &; } The value of $selector is now ((".foo.bar" ".baz.bang"), ".bip.qux"). The compound selectors are quoted here to indicate that they’re strings, but in reality they would be unquoted. Even if the parent selector doesn’t contain a comma or a space, & will alw

map_remove

map_remove($map, $keys...) Returns a new map with keys removed. Like all map functions, map-merge() returns a new map rather than modifying its arguments in place. Examples: map-remove(("foo": 1, "bar": 2), "bar") => ("foo": 1) map-remove(("foo": 1, "bar": 2, "baz": 3), "bar", "baz") => ("foo": 1) map-remove(("foo": 1, "bar": 2), "baz") => ("foo": 1, "bar": 2) Parameters: $map (Map) $keys ([Base]) Returns: (Map) Raises: (ArgumentError) — if $map is not a map

random

random random($limit) Overloads: random Return a decimal between 0 and 1, inclusive of 0 but not 1. Returns: (Number) — A decimal value. random($limit) Return an integer between 1 and $limit, inclusive of both 1 and $limit. Parameters: $limit (Number) — The maximum of the random integer to be returned, a positive integer. Returns: (Number) — An integer. Raises: (ArgumentError) — if the $limit is not 1 or greater

rgb

rgb($red, $green, $blue) Creates a Color object from red, green, and blue values. Parameters: $red (Number) — The amount of red in the color. Must be between 0 and 255 inclusive, or between 0% and 100% inclusive $green (Number) — The amount of green in the color. Must be between 0 and 255 inclusive, or between 0% and 100% inclusive $blue (Number) — The amount of blue in the color. Must be between 0 and 255 inclusive, or between 0% and 100% inclusive Returns: (Color) Raise