// ----------------------------------------------------------------------------- // State constructor // ----------------------------------------------------------------------------- $state-namespace: 'is' !default; @function _state($states...) { $selector: (); $namespace: if($bem-use-namespaces, $state-namespace + '-', ''); @each $state in $states { $s: selector-append(&, '.#{$namespace}#{$state}'); $selector: append($selector, $s, 'comma'); } $set-current: set-current-context('state', $states, $selector); @return $selector; } @mixin state($states...) { @at-root #{_state($states...)} { @content; } $unset-state: unset-current-context('state'); }