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

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 $

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

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_extend

selector_extend($selector, $extendee, $extender) Returns a new version of $selector with $extendee extended with $extender. This works just like the result of $selector { ... } $extender { @extend $extendee } Examples: selector-extend(".a .b", ".b", ".foo .bar") => .a .b, .a .foo .bar, .foo .a .bar Returns A list of lists of strings representing the result of the extension. This is in the same format as a selector returned by &. Parameters: $selector (String, List) — The sele