ceil

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

to_lower_case

to_lower_case($string) Convert a string to lower case, Examples: to-lower-case(ABCD) => abcd Parameters: $string (String) Returns: (String) Raises: (ArgumentError) — if $string isn’t a string

append

append($list, $val, $separator:auto) Appends a single value onto the end of a list. Unless the $separator argument is passed, if the list had only one item, the resulting list will be space-separated. Like all list functions, append() returns a new list rather than modifying its argument in place. Examples: append(10px 20px, 30px) => 10px 20px 30px append((blue, red), green) => blue, red, green append(10px 20px, 30px 40px) => 10px 20px (30px 40px) append(10px, 20px, comma) => 10

call

call($name, $args...) Dynamically calls a function. This can call user-defined functions, built-in functions, or plain CSS functions. It will pass along all arguments, including keyword arguments, to the called function. Examples: call(rgb, 10, 100, 255) => #0a64ff call(scale-color, #0a64ff, $lightness: -10%) => #0058ef $fn: nth; call($fn, (a b c), 2) => b Parameters: $name (String) — The name of the function to call.

opacity

opacity($color) Returns the alpha component (opacity) of a color. This is 1 unless otherwise specified. Parameters: $color (Color) Returns: (Number) — The alpha component, between 0 and 1 Raises: (ArgumentError) — if $color isn’t a color

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.

Data types

Data Types SassScript supports seven main data types: numbers (e.g. 1.2, 13, 10px) strings of text, with and without quotes (e.g. "foo", 'bar', baz) colors (e.g. blue, #04a3f9, rgba(255, 0, 0, 0.5)) booleans (e.g. true, false) nulls (e.g. null) lists of values, separated by spaces or commas (e.g. 1.5em 1em 0 2em, Helvetica, Arial, sans-serif) maps from one value to another (e.g. (key1: value1, key2: value2)) SassScript also supports all other types of CSS property value, such as Unicode range

global_variable_exists

global_variable_exists($name) Check whether a variable with the given name exists in the global scope (at the top level of the file). Examples: $a-false-value: false; global-variable-exists(a-false-value) => true .foo { $some-var: false; @if global-variable-exists(some-var) { /* false, doesn't run */ } } Parameters: $name (String) — The name of the variable to check. The name should not include the $. Returns: (Bool) — Whether the variable is defined in the global scope

mixin_exists

mixin_exists($name) Check whether a mixin with the given name exists. Examples: mixin-exists(nonexistent) => false @mixin red-text { color: red; } mixin-exists(red-text) => true Parameters: name (String) — The name of the mixin to check. Returns: (Bool) — Whether the mixin is defined.

#{}

Interpolation: #{} You can also use SassScript variables in selectors and property names using #{} interpolation syntax: $name: foo; $attr: border; p.#{$name} { #{$attr}-color: blue; } is compiled to: p.foo { border-color: blue; } It’s also possible to use #{} to put SassScript into property values. In most cases this isn’t any better than using a variable, but using #{} does mean that any operations near it will be treated as plain CSS. For example: p { $font-size: 12px; $line-height: