unitless

unitless($number) Returns whether a number has units. Examples: unitless(100) => true unitless(100px) => false Parameters: $number (Number) Returns: (Bool) Raises: (ArgumentError) — if $number isn’t a number

change_color

change_color($color, [$red], [$green], [$blue], [$hue], [$saturation], [$lightness], [$alpha]) Changes one or more properties of a color. This can change the red, green, blue, hue, saturation, value, and alpha properties. The properties are specified as keyword arguments, and replace the color’s current value for that property. All properties are optional. You can’t specify both RGB properties ($red, $green, $blue) and HSL properties ($hue, $saturation, $value) at the same time. Examples: c

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.

list_separator

list_separator($list) Returns the separator of a list. If the list doesn’t have a separator due to having fewer than two elements, returns space. Examples: list-separator(1px 2px 3px) => space list-separator(1px, 2px, 3px) => comma list-separator('foo') => space Parameters: $list (Base) Returns: (String) — comma or space

Functions

Functions SassScript defines some useful functions that are called using the normal CSS function syntax: p { color: hsl(0, 100%, 50%); } is compiled to: p { color: #ff0000; } See this page for a full list of available functions. Keyword Arguments Sass functions can also be called using explicit keyword arguments. The above example can also be written as: p { color: hsl($hue: 0, $saturation: 100%, $lightness: 50%); } While this is less concise, it can make the stylesheet easier to read. It

:nested

:nested Nested style is the default Sass style, because it reflects the structure of the CSS styles and the HTML document they’re styling. Each property has its own line, but the indentation isn’t constant. Each rule is indented based on how deeply it’s nested. For example: #main { color: #fff; background-color: #000; } #main p { width: 10em; } .huge { font-size: 10em; font-weight: bold; text-decoration: underline; } Nested style is very useful when looking at large CSS files:

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

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

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

str_slice

str_slice($string, $start-at, $end-at:-1) Extracts a substring from $string. The substring will begin at index $start-at and ends at index $end-at. Note that unlike some languages, the first character in a Sass string is number 1, the second number 2, and so forth. Examples: str-slice("abcd", 2, 3) => "bc" str-slice("abcd", 2) => "bcd" str-slice("abcd", -3, -2) => "bc" str-slice("abcd", 2, -2) => "bc" Returns The substring. This will be quoted if and only if $string w