Sass selector-unify() Function

Last Updated:

Sass selector-unify() Function

The selector-unify() function returns a selector that matches only elements matched by both $selector1 and $selector2.

Example

SASS TO CSS CONVERTER
#{selector-unify("a", ".disabled")} { color: black; } #{selector-unify("a.disabled", "a.outgoing")} { color: black; } #{selector-unify(".warning a", "main a")} { color: black; }

Syntax

selector-unify($selector1, $selector2)

Parameter Value

ValueTypeExplanation
$selector1 Required Specifies first css selector
$selector2 Required Specifies second css selector

Return Value

ValueExplanation
selector Returns a selector that matches only elements matched by both $selector1 and $selector2.
null Returns null if $selector1 and $selector2 don’t match any of the same elements, or if there’s no selector that can express their overlap.

Share this Page

Meet the Author