Sha256: aedbcae709b21b9966b734d93dd149b481fd4d16e31f9a7c6fd085aca4f6ed35

Contents?: true

Size: 716 Bytes

Versions: 11

Compression:

Stored size: 716 Bytes

Contents

// -----------------------------------------------------------------------------
// 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');
}

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
bem-constructor-0.8.0 stylesheets/_state.scss
bem-constructor-0.7.1 stylesheets/_state.scss
bem-constructor-0.7.0 stylesheets/_state.scss
bem-constructor-0.6.0 stylesheets/_state.scss
bem-constructor-0.5.0 stylesheets/_state.scss
bem-constructor-0.4.0 stylesheets/_state.scss
bem-constructor-0.3.2 stylesheets/_state.scss
bem-constructor-0.3.0 stylesheets/_state.scss
bem-constructor-0.2.0 stylesheets/_state.scss
bem-constructor-0.1.1 stylesheets/_state.scss
bem-constructor-0.1 stylesheets/_state.scss