parent-state

Allows to set a pseudo-element rules depending on its parent state right in the rule set of the pseudo-element itself.

Arguments

NameTypeDefaultDescription
$states *listPseudo-element parent state(s) (pseudo-classes, modifier classes, etc.).

Example

@use 'more-sass' as more;

.element {
    &::after {
        @include more.parent-state(':hover', '.is-active') {
            color: #f00;
        }
    }
}
.element:hover::after,
.element.is-active::after {
    color: #f00;
}
Edit this page on GitHub Updated at Mon, Jan 30, 2023