str_length

str_length($string) Returns the number of characters in a string. Examples: str-length("foo") => 3 Parameters: $string (String) Returns: (Number) Raises: (ArgumentError) — if $string isn’t a string

str_insert

str_insert($string, $insert, $index) Inserts $insert into $string at $index. Note that unlike some languages, the first character in a Sass string is number 1, the second number 2, and so forth. Examples: str-insert("abcd", "X", 1) => "Xabcd" str-insert("abcd", "X", 4) => "abcXd" str-insert("abcd", "X", 5) => "abcdX" Parameters: $string (String) $insert (String) $index (Number) — The position at which $insert will be inserted. Negative indices count from the end of $str

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

set

set Return a new list, based on the list provided, but with the nth element changed to the value given. Note that unlike some languages, the first item in a Sass list is number 1, the second number 2, and so forth. Negative index values address elements in reverse order, starting with the last element in the list. Examples: set-nth($list: 10px 20px 30px, $n: 2, $value: -20px) => 10px -20px 30px Parameters: $list (Base) — The list that will be copied, having the element at index $

simple_selectors

simple_selectors($selector) Returns the simple selectors that comprise the compound selector $selector. Note that $selector must be a compound selector. That means it cannot contain commas or spaces. It also means that unlike other selector functions, this takes only strings, not lists. Examples: simple-selectors(".foo.bar") => ".foo", ".bar" simple-selectors(".foo.bar.baz") => ".foo", ".bar", ".baz" Returns A list of simple selectors in the compound selector. Parameters: $sele

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

selector_parse

selector_parse($selector) Parses a user-provided selector into a list of lists of strings as returned by &. Examples: selector-parse(".foo .bar, .baz .bang") => ('.foo' '.bar', '.baz' '.bang') Returns A list of lists of strings representing $selector. This is in the same format as a selector returned by &. Parameters: $selector (String, List) — The selector to parse. This can be either a string, a list of strings, or a list of lists of strings as returned by &. Retu

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

selector_replace

selector_replace($selector, $original, $replacement) Replaces all instances of $original with $replacement in $selector This works by using @extend and throwing away the original selector. This means that it can be used to do very advanced replacements; see the examples below. Examples: selector-replace(".foo .bar", ".bar", ".baz") => ".foo .baz" selector-replace(".foo.bar.baz", ".foo.baz", ".qux") => ".bar.qux" Returns A list of lists of strings representing the result of the exte

selector_append

selector_append($selectors...) Return a new selector with all selectors in $selectors appended one another as though they had been nested in the stylesheet as $selector1 { &$selector2 { ... } }. Examples: selector-append(".foo", ".bar", ".baz") => .foo.bar.baz selector-append(".a .foo", ".b .bar") => "a .foo.b .bar" selector-append(".foo", "-suffix") => ".foo-suffix" Returns A list of lists of strings representing the result of appending $selectors. This is in the same forma