From ac04c0bb55f51dd18daaf6813c47a0db8525180f Mon Sep 17 00:00:00 2001 From: Volpeon Date: Sat, 28 Jan 2023 09:34:19 +0100 Subject: Added overflow button --- src/objects/_overflow-button.scss | 132 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 132 insertions(+) create mode 100644 src/objects/_overflow-button.scss (limited to 'src/objects/_overflow-button.scss') diff --git a/src/objects/_overflow-button.scss b/src/objects/_overflow-button.scss new file mode 100644 index 0000000..4cea74a --- /dev/null +++ b/src/objects/_overflow-button.scss @@ -0,0 +1,132 @@ +@use 'iro-sass/src/index' as iro; +@use '../functions' as fn; + +@include iro.props-namespace('overflow-button') { + @include iro.props-store(( + --dims: ( + --pad-x: fn.global-dim(--size --125), + --pad-y: fn.global-dim(--size --125), + --spacing: fn.global-dim(--size --50), + ), + ), 'dims'); + + @include iro.props-store(( + --colors: ( + --label: fn.global-color(--fg), + + --hover: ( + --bg: fn.global-color(--obj-hi), + --label: fn.global-color(--fg-lo), + ), + --active: ( + --bg: fn.global-color(--obj), + --label: fn.global-color(--fg-lo), + ), + --selected: ( + --bg: fn.global-color(--obj-hi), + --label: fn.global-color(--fg), + + --hover: ( + --label: fn.global-color(--fg-lo), + ), + ), + --disabled: ( + --label: fn.global-color(--fg-hi3), + ), + --key-focus: ( + --border: fn.global-color(--focus --fill), + --shadow: fn.global-color(--focus --shadow), + ), + ), + ), 'colors'); + + @include iro.bem-object(iro.props-namespace()) { + display: inline-block; + color: fn.color(--disabled --label); + + @include iro.bem-elem('inside') { + display: inline-block; + padding: fn.dim(--pad-y) fn.dim(--pad-x); + border: 1px solid transparent; + border-radius: 100em; + line-height: 1; + text-align: center; + text-decoration: none; + text-overflow: ellipsis; + white-space: nowrap; + } + + @include iro.bem-elem('outside') { + display: inline-block; + margin-left: fn.dim(--spacing); + } + + &:link, + &:visited, + &:enabled { + @include iro.bem-elem('inside') { + color: fn.color(--label); + } + + &:hover { + @include iro.bem-elem('inside') { + background-color: fn.color(--hover --bg); + color: fn.color(--hover --label); + } + } + + &:active { + @include iro.bem-elem('inside') { + background-color: fn.color(--active --bg); + color: fn.color(--active --label); + } + } + + @include iro.bem-at-theme('keyboard') { + &:focus { + @include iro.bem-elem('inside') { + background-color: fn.color(--hover --bg); + color: fn.color(--hover --label); + } + } + } + } + + @include iro.bem-is('selected') { + &:link, + &:visited, + &:enabled { + @include iro.bem-elem('inside') { + background-color: fn.color(--selected --bg); + color: fn.color(--selected --label); + } + + &:hover, + &:active { + @include iro.bem-elem('inside') { + background-color: fn.color(--selected --bg); + color: fn.color(--selected --hover --label); + } + } + + @include iro.bem-at-theme('keyboard') { + &:focus { + @include iro.bem-elem('inside') { + background-color: fn.color(--selected --bg); + color: fn.color(--selected --hover --label); + } + } + } + } + } + + @include iro.bem-at-theme('keyboard') { + &:focus { + @include iro.bem-elem('inside') { + border-color: fn.color(--key-focus --border); + box-shadow: inset 0 0 0 1px fn.color(--key-focus --border), fn.color(--key-focus --shadow); + } + } + } + } +} -- cgit v1.2.3-70-g09d2