
@forward '../abstract/element-prefix' show $tag-prefix;
@use '../abstract/element-prefix' as *;

/** The element's tag: `tag('button')` is `m-button`. */
@function tag($name) {
@return '#{$tag-prefix}-#{$name}';
}

/** Rules for the undefined host. */
@mixin host($name) {
#{tag($name)}:not(:defined) {
@content;
}
}

/**
 * Declaration children (`<m-tab>`) and other content that only means
 * something after upgrade: kept in the flow to reserve their space, but not
 * painted.
 */
@mixin declarations($name, $selector: '*') {
#{tag($name)}:not(:defined) > #{$selector} {
visibility: hidden;
@content;
}
}

/** An overlay renders nothing until upgrade, open or not: it opens in the top layer. */
@mixin overlay($name) {
@include host($name) {
display: none;
}
}
