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

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

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

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

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 $

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_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_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