Sha256: bbfdd40f3e65738df4d2935d5261e2a92cfdd6f08d07485c1881bc5ea2e18870

Contents?: true

Size: 1005 Bytes

Versions: 2

Compression:

Stored size: 1005 Bytes

Contents

// -----------------------------------------------------------------------------
// 11. Hack constructor
// -----------------------------------------------------------------------------

/// Hack namespace prepended to the selector
$hack-namespace: '_' !default;

@function _hack() {

    // You may not hack a hack
    $recursive-check: should-not-be-called-recursively('hack');

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

    @each $s in & {
        $selector-to-str: inspect(nth($s, 1));
        $selector-without-dot: str-slice($selector-to-str, 2, -1);
        $new-selector: '.' + $namespace + $selector-without-dot;
        $sl: selector-replace($s, nth($s, 1), $new-selector);;
        $selector: append($selector, $sl, 'comma');
    }

    $set-current: set-current-context('hack', 'some-hack', $selector);

    @return $selector;

}

@mixin hack() {

    @at-root #{_hack()} {
        @content;
    }

    $unset-current: unset-current-context('hack');

}

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
bem-constructor-0.1.1 stylesheets/_hack.scss
bem-constructor-0.1 stylesheets/_hack.scss