Sha256: e7e413233dec814618fe97b966190cb01ddb814e3dffb2dcd1045e9f8cfeb0ea

Contents?: true

Size: 934 Bytes

Versions: 5

Compression:

Stored size: 934 Bytes

Contents

// -----------------------------------------------------------------------------
// Theme constructor
// -----------------------------------------------------------------------------

$bem-theme-namespace: 't' !default;

@function _theme($themes...) {

    // If you try to hack a hack you can break the internet.
    // So please, no one try it.
    $recursive-test: should-not-be-called-recursively('theme');

    $selector: ();
    $namespace: if($bem-use-namespaces, $bem-theme-namespace + '-', '');

    @each $theme in $themes {
        @each $sel in & {
            $t: selector-nest('.#{$namespace}#{$theme}', $sel);
            $selector: append($selector, $t, 'comma');
        }
    }

    $set-current: set-current-context('theme', $themes, $selector);

    @return $selector;
}

@mixin theme($themes...) {

    @at-root #{_theme($themes...)} {
      @content;
    }

    $unset-current: unset-current-context('theme');
}

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
bem-constructor-0.5.0 stylesheets/_theme.scss
bem-constructor-0.4.0 stylesheets/_theme.scss
bem-constructor-0.3.2 stylesheets/_theme.scss
bem-constructor-0.3.0 stylesheets/_theme.scss
bem-constructor-0.2.0 stylesheets/_theme.scss