@use 'sass:map'; @use 'sass:meta'; @use 'sass:string'; @use 'iro-sass/src/bem'; @use 'iro-sass/src/props'; @use '../props' as *; @forward 'tabs.vars'; @use 'tabs.vars' as vars; @mixin styles { @include materialize-at-root(meta.module-variables('vars')); @include bem.object('tabs') { position: relative; display: flex; gap: props.get(vars.$spacing); min-inline-size: 0; block-size: props.get(vars.$block-size); padding-inline: calc(.5 * props.get(vars.$spacing)); margin-inline: calc(-.5 * props.get(vars.$spacing)); overflow-inline: auto; &::after { position: absolute; inset-block-end: 0; inset-inline: calc(.5 * props.get(vars.$spacing)); z-index: -10; block-size: props.get(vars.$indicator--width); content: ''; background-color: props.get(vars.$railing--bg-color); } @include bem.modifier('quiet') { &::after { display: none; } } @include bem.modifier('adapt') { block-size: 100%; } @include bem.elem('tab') { position: relative; display: flex; align-items: center; color: props.get(vars.$tab--text-color); white-space: nowrap; border-block: props.get(vars.$indicator--width) solid transparent; &::before { position: absolute; inset-block-start: 50%; inset-inline: calc(-1 * props.get(vars.$tab--pad-i)); z-index: -10; block-size: 1.5em; content: ''; border-radius: props.get(vars.$rounding); transform: translateY(-50%); } &:link, &:visited { &:hover, &:active, &:focus-visible { color: props.get(vars.$tab--selected--text-color); } &:focus-visible { &::before { color: props.get(vars.$key-focus--text-color); text-decoration: none; outline: props.get(vars.$key-focus--border-color) solid props.get(vars.$key-focus--border-width); box-shadow: 0 0 0 calc(props.get(vars.$key-focus--border-width) + props.get(vars.$key-focus--outline-width)) props.get(vars.$key-focus--outline-color); } } } @include bem.is('selected') { color: props.get(vars.$tab--selected--text-color); border-block-end-color: props.get(vars.$tab--selected--text-color); } } @include bem.elem('caret') { display: none; } @include bem.modifier('accent') { @include bem.elem('tab') { @include bem.is('selected') { color: props.get(vars.$tab--accent--text-color); border-block-end-color: props.get(vars.$tab--accent--text-color); } } } @include bem.is('collapsed') { @include bem.elem('tab') { display: none; @include bem.is('selected') { display: flex; color: props.get(vars.$tab--text-color); border-block-end-color: transparent; &:link, &:visited { &:hover, &:active, &:focus-visible { color: props.get(vars.$tab--selected--text-color); } } } } @include bem.elem('caret') { display: block; } } } }