lightness

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

lighten

lighten($color, $amount) Makes a color lighter. Takes a color and a number between 0% and 100%, and returns a color with the lightness increased by that amount. Examples: lighten(hsl(0, 0%, 0%), 30%) => hsl(0, 0, 30) lighten(#800, 20%) => #e00 Parameters: $color (Color) $amount (Number) — The amount to increase the lightness by, between 0% and 100% Returns: (Color) Raises: (ArgumentError) — if $amount is out of bounds, or either parameter is the wrong type

length

length($list) Return the length of a list. This can return the number of pairs in a map as well. Examples: length(10px) => 1 length(10px 20px 30px) => 3 length((width: 10px, height: 20px)) => 2 Parameters: $list (Base) Returns: (Number)

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

join

join($list1, $list2, $separator:auto) Joins together two lists into one. Unless $separator is passed, if one list is comma-separated and one is space-separated, the first parameter’s separator is used for the resulting list. If both lists have fewer than two items, spaces are used for the resulting list. Like all list functions, join() returns a new list rather than modifying its arguments in place. Examples: join(10px 20px, 30px 40px) => 10px 20px 30px 40px join((blue, red), (#abc, #def

is_superselector

is_superselector($super, $sub) Returns whether $super is a superselector of $sub. This means that $super matches all the elements that $sub matches, as well as possibly additional elements. In general, simpler selectors tend to be superselectors of more complex oned. Examples: is-superselector(".foo", ".foo.bar") => true is-superselector(".foo.bar", ".foo") => false is-superselector(".bar", ".foo .bar") => true is-superselector(".foo .bar", ".bar") => false Returns Whether $s

invert

invert($color) Returns the inverse (negative) of a color. The red, green, and blue values are inverted, while the opacity is left alone. Parameters: $color (Color) Returns: (Color) Raises: (ArgumentError) — if $color isn’t a color

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

inspect

inspect($value) Return a string containing the value as its Sass representation. Parameters: $value (Base) — The value to inspect. Returns: (String) — A representation of the value as it would be written in Sass.

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