/* stylelint-disable length-zero-no-unit */ @use 'iro-sass/src/iro-sass' as iro; @use '../functions' as fn; @use './icon'; @include iro.props-namespace('menu') { @include iro.props-store(( --dims: ( --spacing: 0em, --header: ( --font-size: fn.global-dim(--font-size --50), ), --separator: fn.global-dim(--size --100), --item: ( --pad-i: fn.global-dim(--size --150), --pad-b: fn.global-dim(--size --100), --rounding: 0em, --key-focus: ( --border: fn.global-dim(--key-focus --border), --border-offset: fn.global-dim(--key-focus --border-offset), --outline: fn.global-dim(--key-focus --outline), ), ), ), --colors: ( --separator: fn.global-color(--border), --header: ( --label: fn.global-color(--heading), ), --item: ( --hover: ( --bg: fn.global-color(--border-mute), --label: fn.global-color(--heading), ), --active: ( --bg: fn.global-color(--border), --label: fn.global-color(--heading), ), --disabled: ( --label: fn.global-color(--text-disabled), ), --key-focus: ( --border: fn.global-color(--focus --border), --outline: fn.global-color(--focus --outline), ), ), ), )); @include iro.bem-object(iro.props-namespace()) { display: flex; flex-direction: column; gap: fn.dim(--spacing); @include iro.bem-elem('header') { padding-block: fn.dim(--item --pad-b); padding-inline: fn.dim(--item --pad-i); font-size: fn.dim(--header --font-size); font-weight: 500; color: fn.color(--header --label); text-transform: uppercase; letter-spacing: .5px; @include iro.bem-next-twin-elem { margin-block-start: calc(fn.dim(--separator) + fn.dim(--spacing)); } } @include iro.bem-elem('item') { padding-block: fn.dim(--item --pad-b); padding-inline: fn.dim(--item --pad-i); margin: calc(-1 * fn.dim(--item --key-focus --outline)); color: fn.color(--item --disabled --label); background-clip: padding-box; border: fn.dim(--item --key-focus --outline) solid transparent; border-radius: calc(fn.dim(--item --rounding) + fn.dim(--item --key-focus --outline)); &:link, &:visited, &:enabled { color: currentColor; @include iro.bem-multi('&:hover, &:focus-visible', 'is' 'selected') { color: fn.color(--item --hover --label); background-color: fn.color(--item --hover --bg); } &:active { color: fn.color(--item --active --label); background-color: fn.color(--item --active --bg); } &:focus-visible { outline: fn.color(--item --key-focus --border) solid fn.dim(--item --key-focus --border); box-shadow: 0 0 0 calc(fn.dim(--item --key-focus --border) + fn.dim(--item --key-focus --outline)) fn.color(--item --key-focus --outline); } } @include iro.bem-next-elem('header') { margin-block-start: calc(fn.dim(--separator) + fn.dim(--spacing)); } } @include iro.bem-elem('header') { &:link, &:visited, &:enabled { color: fn.color(--header --label); } } @include iro.bem-elem('separator') { block-size: 1px; margin-block: fn.dim(--separator); margin-inline: fn.dim(--item --pad-i); background-color: fn.color(--separator); } @include iro.bem-elem('slot') { padding-block: fn.dim(--item --pad-b); padding-inline: fn.dim(--item --pad-i); } @include iro.bem-elem('icon-slot') { display: flex; justify-content: center; inline-size: fn.foreign-dim(--icon, --size); } @include iro.bem-modifier('pull') { margin: calc(-1 * fn.dim(--item --pad-i)); } } }