selector_unify

selector_unify($selector1, $selector2) Unifies two selectors into a single selector that matches only elements matched by both input selectors. Returns null if there is no such selector. Like the selector unification done for @extend, this doesn’t guarantee that the output selector will match all elements matched by both input selectors. For example, if .a .b is unified with .x .y, .a .x .b.y, .x .a .b.y will be returned, but .a.x .b.y will not. This avoids exponential output size while match

type_of

type_of($value) Returns the type of a value. Examples: type-of(100px) => number type-of(asdf) => string type-of("asdf") => string type-of(true) => bool type-of(#fff) => color type-of(blue) => color Parameters: $value (Base) — The value to inspect Returns: (String) — The unquoted string name of the value’s type

feature_exists

feature_exists($feature) Returns whether a feature exists in the current Sass runtime. The following features are supported: global-variable-shadowing indicates that a local variable will shadow a global variable unless !global is used. extend-selector-pseudoclass indicates that @extend will reach into selector pseudoclasses like :not. units-level-3 indicates full support for unit arithmetic using units defined in the Values and Units Level 3 spec. at-error indicates that the Sass @e

min

min($numbers...) Finds the minimum of several numbers. This function takes any number of arguments. Examples: min(1px, 4px) => 1px min(5em, 3em, 4em) => 3em Parameters: $numbers ([Number]) Returns: (Number) Raises: (ArgumentError) — if any argument isn’t a number, or if not all of the arguments have comparable units

Interactive shell

Interactive Shell You can easily experiment with SassScript using the interactive shell. To launch the shell run the sass command-line with the -i option. At the prompt, enter any legal SassScript expression to have it evaluated and the result printed out for you: $ sass -i >> "Hello, Sassy World!" "Hello, Sassy World!" >> 1px + 1px + 1px 3px >> #777 + #777 #eeeeee >> #777 + #888 white

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

green

green($color) Gets the green component of a color. Calculated from HSL where necessary via this algorithm. Parameters: $color (Color) Returns: (Number) — The green component, between 0 and 255 inclusive Raises: (ArgumentError) — if $color isn’t a color

str_insert

str_insert($string, $insert, $index) Inserts $insert into $string at $index. Note that unlike some languages, the first character in a Sass string is number 1, the second number 2, and so forth. Examples: str-insert("abcd", "X", 1) => "Xabcd" str-insert("abcd", "X", 4) => "abcXd" str-insert("abcd", "X", 5) => "abcdX" Parameters: $string (String) $insert (String) $index (Number) — The position at which $insert will be inserted. Negative indices count from the end of $str

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

@warn

@warn The @warn directive prints the value of a SassScript expression to the standard error output stream. It’s useful for libraries that need to warn users of deprecations or recovering from minor mixin usage mistakes. There are two major distinctions between @warn and @debug: You can turn warnings off with the --quiet command-line option or the :quiet Sass option. A stylesheet trace will be printed out along with the message so that the user being warned can see where their styles caused the