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 extension. This is in the same format as a selector returned by &.

Parameters:

  • $selector (String, List) The selector within which $original is replaced with $replacement. This can be either a string, a list of strings, or a list of lists of strings as returned by &.
  • $original (String, List) The selector being replaced. This can be either a string, a list of strings, or a list of lists of strings as returned by &.
  • $replacement (String, List) The selector that $original is being replaced with. This can be either a string, a list of strings, or a list of lists of strings as returned by &.

Returns:

  • (List) A list of lists of strings representing the result of the extension. This is in the same format as a selector returned by &.

Raises:

  • (ArgumentError) if the replacement fails
doc_Sass
2016-11-11 13:09:24
Comments
Leave a Comment

Please login to continue.