Sha256: c388c708caef4ae4b300285891dbbcf43f70f55719410f03d05e5031992b457c
Contents?: true
Size: 1.57 KB
Versions: 4
Compression:
Stored size: 1.57 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('block', 'modifier', 'state', 'theme'); $outside-check: _should-not-be-called-within('element'); // Return false in case error throwing is disabled @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'); } $block: selector-append(&...); $selector: selector-nest($block, '>', $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
4 entries across 4 versions & 1 rubygems