alpha

alpha($color) Returns the alpha component (opacity) of a color. This is 1 unless otherwise specified. This function also supports the proprietary Microsoft alpha(opacity=20) syntax as a special case. Parameters: $color (Color) Returns: (Number) — The alpha component, between 0 and 1 Raises: (ArgumentError) — if $color isn’t a color

selector_unify

selector_unify($selector1, $selector2) Unifies two selectors into a single selector that matches only elements matched by both input selectors. Returns null if there is no such selector. Like the selector unification done for @extend, this doesn’t guarantee that the output selector will match all elements matched by both input selectors. For example, if .a .b is unified with .x .y, .a .x .b.y, .x .a .b.y will be returned, but .a.x .b.y will not. This avoids exponential output size while match

feature_exists

feature_exists($feature) Returns whether a feature exists in the current Sass runtime. The following features are supported: global-variable-shadowing indicates that a local variable will shadow a global variable unless !global is used. extend-selector-pseudoclass indicates that @extend will reach into selector pseudoclasses like :not. units-level-3 indicates full support for unit arithmetic using units defined in the Values and Units Level 3 spec. at-error indicates that the Sass @e

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

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

transparentize

transparentize($color, $amount) Also known as: fade_out Makes a color more transparent. Takes a color and a number between 0 and 1, and returns a color with the opacity decreased by that amount. Examples: transparentize(rgba(0, 0, 0, 0.5), 0.1) => rgba(0, 0, 0, 0.4) transparentize(rgba(0, 0, 0, 0.8), 0.2) => rgba(0, 0, 0, 0.6) Parameters: $color (Color) $amount (Number) — The amount to decrease the opacity by, between 0 and 1 Returns: (Color) Raises: (ArgumentError) —

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

str_index

str_index($string, $substring) Returns the index of the first occurrence of $substring in $string. If there is no such occurrence, returns null. Note that unlike some languages, the first character in a Sass string is number 1, the second number 2, and so forth. Examples: str-index(abcd, a) => 1 str-index(abcd, ab) => 1 str-index(abcd, X) => null str-index(abcd, c) => 3 Parameters: $string (String) $substring (String) Returns: (Number, Null) Raises: (ArgumentErr

Operations

Operations All types support equality operations (== and !=). In addition, each type has its own operations that it has special support for. Number Operations SassScript supports the standard arithmetic operations on numbers (addition +, subtraction -, multiplication *, division /, and modulo %). Sass math functions preserve units during arithmetic operations. This means that, just like in real life, you cannot work on numbers with incompatible units (such as adding a number with px and em) and