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

set

set Return a new list, based on the list provided, but with the nth element changed to the value given. Note that unlike some languages, the first item in a Sass list is number 1, the second number 2, and so forth. Negative index values address elements in reverse order, starting with the last element in the list. Examples: set-nth($list: 10px 20px 30px, $n: 2, $value: -20px) => 10px -20px 30px Parameters: $list (Base) — The list that will be copied, having the element at index $

selector_parse

selector_parse($selector) Parses a user-provided selector into a list of lists of strings as returned by &. Examples: selector-parse(".foo .bar, .baz .bang") => ('.foo' '.bar', '.baz' '.bang') Returns A list of lists of strings representing $selector. This is in the same format as a selector returned by &. Parameters: $selector (String, List) — The selector to parse. This can be either a string, a list of strings, or a list of lists of strings as returned by &. Retu

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

scale_color

scale_color($color, [$red], [$green], [$blue], [$saturation], [$lightness], [$alpha]) Fluidly scales one or more properties of a color. Unlike adjust-color, which changes a color’s properties by fixed amounts, scale-color fluidly changes them based on how high or low they already are. That means that lightening an already-light color with scale-color won’t change the lightness much, but lightening a dark color by the same amount will change it more dramatically. This has the benefit of making

hsla

hsla($hue, $saturation, $lightness, $alpha) Creates a Color from hue, saturation, lightness, and alpha values. Uses the algorithm from the CSS3 spec. Parameters: $hue (Number) — The hue of the color. Should be between 0 and 360 degrees, inclusive $saturation (Number) — The saturation of the color. Must be between 0% and 100%, inclusive $lightness (Number) — The lightness of the color. Must be between 0% and 100%, inclusive $alpha (Number) — The opacity of the color. Must b

opacify

opacify($color, $amount) Also known as: fade_in Makes a color more opaque. Takes a color and a number between 0 and 1, and returns a color with the opacity increased by that amount. Examples: opacify(rgba(0, 0, 0, 0.5), 0.1) => rgba(0, 0, 0, 0.6) opacify(rgba(0, 0, 17, 0.8), 0.2) => #001 Parameters: $color (Color) $amount (Number) — The amount to increase the opacity by, between 0 and 1 Returns: (Color) Raises: (ArgumentError) — if $amount is out of bounds, or either

adjust_hue

adjust_hue($color, $degrees) Changes the hue of a color. Takes a color and a number of degrees (usually between -360deg and 360deg), and returns a color with the hue rotated along the color wheel by that amount. Examples: adjust-hue(hsl(120, 30%, 90%), 60deg) => hsl(180, 30%, 90%) adjust-hue(hsl(120, 30%, 90%), -60deg) => hsl(60, 30%, 90%) adjust-hue(#811, 45deg) => #886a11 Parameters: $color (Color) $degrees (Number) — The number of degrees to rotate the hue Returns:

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

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