@use 'iro-sass/src/index' as iro; @use '../functions' as fn; @include iro.props-namespace('action-menu') { @include iro.props-store(( --dims: ( --pad-x: 0, --pad-y: iro.fn-px-to-rem(5px), --separator: iro.fn-px-to-rem(5px), --rounding: 3px, --border: 1px, --item: ( --pad-x: iro.fn-px-to-rem(12px), --pad-y: iro.fn-px-to-rem(7px), ), ), ), 'dims'); @include iro.props-store(( --colors: ( --shadow: 0 .2em .5em rgba(#000, .2), --border: rgba(#000, .2), --separator: fn.global-color(--obj), --icon: fn.global-color(--fg-hi), --item: ( --hover: ( --bg: fn.global-color(--obj-hi), --label: fn.global-color(--fg-lo), ), --disabled: ( --label: fn.global-color(--fg-hi3), ), --key-focus: ( --bg: fn.global-color(--obj-hi), --label: fn.global-color(--fg-lo), --border: fn.global-color(--focus --fill), --shadow: fn.global-color(--focus --shadow), ), ), ), ), 'colors'); @include iro.bem-object(iro.props-namespace()) { position: absolute; z-index: 10000; top: var(--y); left: var(--x); padding: fn.dim(--pad-y) fn.dim(--pad-x); border: fn.dim(--border) solid fn.color(--border); border-radius: fn.dim(--rounding); background-color: fn.global-color(--bg); box-shadow: fn.color(--shadow); color: fn.global-color(--fg); @include iro.bem-modifier('up-left') { transform: translate(0, -100%); } @include iro.bem-modifier('up-right') { transform: translate(-100%, -100%); } @include iro.bem-modifier('down-right') { transform: translate(-100%, 0); } @include iro.bem-elem('item') { display: block; box-sizing: border-box; width: 100%; padding: calc(fn.dim(--item --pad-y) - 2px) calc(fn.dim(--item --pad-x) - 2px); border: 2px solid transparent; color: fn.color(--item --disabled --label); &:link, &:visited, &:enabled { color: currentColor; &:hover, &:active { background-color: fn.color(--item --hover --bg); color: fn.color(--item --hover --label); } @include iro.bem-at-theme('keyboard') { &:focus { border-radius: 2px; border-color: fn.color(--item --key-focus --border); background-color: fn.color(--item --key-focus --bg); box-shadow: fn.color(--item --key-focus --shadow); color: fn.color(--item --key-focus --label); } } } } @include iro.bem-elem('separator') { height: 1px; margin: fn.dim(--separator) 0; background-color: fn.color(--separator); } @include iro.bem-elem('slot') { padding: fn.dim(--item --pad-y) fn.dim(--item --pad-x); } @include iro.bem-elem('icon-slot') { display: flex; justify-content: center; width: 1em; } } }