//// /// @group BEM /// /// @access public //// /// /// Declare new rules for the current block for when this theme is active. /// /// @param {string} $name - First theme block name /// @param {string} $names - More theme block names /// /// @content /// @mixin iro-bem-at-theme($name, $names...) { $result: iro-bem-at-theme($name, $names...); $selector: nth($result, 1); $context: nth($result, 2); @include iro-bem-validate( 'at-theme', (name: $name, names: $names), $selector, $context ); @include iro-context-push($iro-bem-context-id, $context...); @at-root #{$selector} { @content; } @include iro-context-pop($iro-bem-context-id); } /// /// Declare new rules for the current block for when this theme is active. /// Check the respective mixin documentation for more information. /// /// @return {list} A list with two items: 1. selector, 2. context or `null` /// /// @see {mixin} iro-bem-at-theme /// @function iro-bem-at-theme($name, $names...) { $noop: iro-context-assert-stack-must-contain($iro-bem-context-id, 'block'); $parent-context: iro-context-get($iro-bem-context-id, 'block'); $parent-selector: map-get(nth($parent-context, 2), 'selector'); @if not iro-selector-suffix-match(&, $parent-selector) { @error 'An at-theme rule must be an immediate child of a block'; } $selector: iro-bem-theme-selector($name, $names...); $selector: selector-nest($selector, &); $context: 'at-theme', ( 'name': join($name, $names), 'selector': $selector ); @return $selector $context; }