Sha256: a3d8c27483c44cea5480fc323468e6550bdb04dff2e5aaebdad1ff34043ec403
Contents?: true
Size: 1.45 KB
Versions: 1
Compression:
Stored size: 1.45 KB
Contents
// ---------------------------------------------------------------------- // Element modifier // ---------------------------------------------------------------------- /// Scopes the @content ruleset to an element of the block being modified /// @private /// @param {String | Arglist} $modified-elements - List of elements that should be modified /// @returns The final selector for the element(s) modified by the block modifier @function _modifies-element($modified-elements...) { $inside-check: _should-be-called-within('modifier', 'state'); $outside-check: _should-not-be-called-within('element'); @if $inside-check == 'false' or $outside-check == false { @return false; } $selectors: (); @each $element in $modified-elements { $element: map-get(map-get($_bem-current-context, 'block'), 'selector') + $bem-element-separator + $element; $selectors: append($selectors, $element, 'comma'); } $selector: selector-nest(&, $selectors); $set-current: set-current-context('modifies-element', $modified-elements, $selector); @return $selector; } /// Scopes the @content ruleset to an element of the block being modified /// @param {String | Arglist} $modified-elements - Name of the element(s) that should be modified @mixin modifies-element($modified-elements...) { @at-root #{_modifies-element($modified-elements...)} { @content; } $unset-current: unset-current-context('modifies-element'); }
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
bem-constructor-0.3.2 | stylesheets/_modifies-element.scss |