if

if($condition, $if-true, $if-false) Returns one of two values, depending on whether or not $condition is true. Just like in @if, all values other than false and null are considered to be true. Examples: if(true, 1px, 2px) => 1px if(false, 1px, 2px) => 2px Parameters: $condition (Base) — Whether the $if-true or $if-false will be returned $if-true (Tree::Node) $if-false (Tree::Node) Returns: (Base) — $if-true or $if-false

ie_hex_str

ie_hex_str($color) Converts a color into the format understood by IE filters. Examples: ie-hex-str(#abc) => #FFAABBCC ie-hex-str(#3322BB) => #FF3322BB ie-hex-str(rgba(0, 255, 0, 0.5)) => #8000FF00 Parameters: $color (Color) Returns: (String) — The IE-formatted string representation of the color Raises: (ArgumentError) — if $color isn’t a color

hue

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

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

hsl

hsl($hue, $saturation, $lightness) Creates a Color from hue, saturation, and lightness 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 Returns: (Color) Raises: (ArgumentError) — if $saturation or $l

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

grayscale

grayscale($color) Converts a color to grayscale. This is identical to desaturate(color, 100%). Parameters: $color (Color) Returns: (Color) Raises: (ArgumentError) — if $color isn’t a color

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

function_exists

function_exists($name) Check whether a function with the given name exists. Examples: function-exists(lighten) => true @function myfunc { @return "something"; } function-exists(myfunc) => true Parameters: name (String) — The name of the function to check. Returns: (Bool) — Whether the function is defined.

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