comparable

comparable($number1, $number2) Returns whether two numbers can added, subtracted, or compared. Examples: comparable(2px, 1px) => true comparable(100px, 3em) => false comparable(10cm, 3mm) => true Parameters: $number1 (Number) $number2 (Number) Returns: (Bool) Raises: (ArgumentError) — if either parameter is the wrong type

floor

floor($number) Rounds a number down to the previous whole number. Examples: floor(10.4px) => 10px floor(10.6px) => 10px Parameters: $number (Number) Returns: (Number) Raises: (ArgumentError) — if $number isn’t a number

selector_nest

selector_nest($selectors...) Return a new selector with all selectors in $selectors nested beneath one another as though they had been nested in the stylesheet as $selector1 { $selector2 { ... } }. Unlike most selector functions, selector-nest allows the parent selector & to be used in any selector but the first. Examples: selector-nest(".foo", ".bar", ".baz") => .foo .bar .baz selector-nest(".a .foo", ".b .bar") => .a .foo .b .bar selector-nest(".foo", "&.bar") => .foo.bar

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

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

@extend

@extend There are often cases when designing a page when one class should have all the styles of another class, as well as its own specific styles. The most common way of handling this is to use both the more general class and the more specific class in the HTML. For example, suppose we have a design for a normal error and also for a serious error. We might write our markup like so: <div class="error seriousError"> Oh no! You've been hacked! </div> And our styles like so: .error

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

red

red($color) Gets the red component of a color. Calculated from HSL where necessary via this algorithm. Parameters: $color (Color) Returns: (Number) — The red component, between 0 and 255 inclusive Raises: (ArgumentError) — if $color isn’t a color

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

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