From 48cb00040763459fc46d4aa108bf72c12f48f422 Mon Sep 17 00:00:00 2001 From: Volpeon Date: Fri, 21 Jun 2024 23:07:50 +0200 Subject: WIP: Refactoring --- src/.old/objects/_action-button.scss | 222 +++++++++++++++++++++++++++++++++++ 1 file changed, 222 insertions(+) create mode 100644 src/.old/objects/_action-button.scss (limited to 'src/.old/objects/_action-button.scss') diff --git a/src/.old/objects/_action-button.scss b/src/.old/objects/_action-button.scss new file mode 100644 index 0000000..48ac2a6 --- /dev/null +++ b/src/.old/objects/_action-button.scss @@ -0,0 +1,222 @@ +@use 'iro-sass/src/index' as iro; +@use '../functions' as fn; + +@include iro.props-namespace('action-button') { + @include iro.props-store(( + --dims: ( + --line-height: 1.4, + --pad-x: fn.global-dim(--size --100), + --pad-y: fn.global-dim(--size --85), + --rounding: 3px, + ), + ), 'dims'); + + @include iro.props-store(( + --colors: ( + --bg: fn.global-color(--bg-hi), + --label: fn.global-color(--fg), + --border: fn.global-color(--obj-lo), + + --hover: ( + --bg: fn.global-color(--bg-hi2), + --label: fn.global-color(--fg-lo), + --border: fn.global-color(--fg-hi2), + ), + --active: ( + --bg: fn.global-color(--obj-hi), + --label: fn.global-color(--fg-lo), + --border: fn.global-color(--fg-hi2), + ), + --selected: ( + --bg: fn.global-color(--obj-hi), + --label: fn.global-color(--fg), + --border: fn.global-color(--fg-hi3), + + --hover: ( + --label: fn.global-color(--fg-lo), + --border: fn.global-color(--fg-hi2), + ), + ), + --disabled: ( + --bg: fn.global-color(--obj-hi), + --label: fn.global-color(--fg-hi3), + --border: fn.global-color(--obj-hi), + ), + --key-focus: ( + --border: fn.global-color(--focus --fill), + --shadow: fn.global-color(--focus --shadow), + ), + --quiet: ( + --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: ( + --bg: fn.global-color(--obj), + --label: fn.global-color(--fg-lo), + ), + ), + --disabled: ( + --label: fn.global-color(--fg-hi3), + ), + ), + ), + ), 'colors'); + + @include iro.bem-object(iro.props-namespace()) { + display: inline-block; + padding: fn.dim(--pad-y) fn.dim(--pad-x); + overflow: hidden; + border: 1px solid fn.color(--disabled --border); + border-radius: fn.dim(--rounding); + background-color: fn.color(--disabled --bg); + color: fn.color(--disabled --label); + line-height: fn.dim(--line-height); + text-align: center; + text-decoration: none; + text-overflow: ellipsis; + vertical-align: top; + white-space: nowrap; + + &:link, + &:visited, + &:enabled { + border-color: fn.color(--border); + background-color: fn.color(--bg); + color: fn.color(--label); + + &:hover { + border-color: fn.color(--hover --border); + background-color: fn.color(--hover --bg); + color: fn.color(--hover --label); + } + + &:active { + border-color: fn.color(--active --border); + background-color: fn.color(--active --bg); + color: fn.color(--active --label); + } + + @include iro.bem-at-theme('keyboard') { + &:focus { + background-color: fn.color(--hover --bg); + color: fn.color(--hover --label); + } + } + } + + @include iro.bem-is('selected') { + &:link, + &:visited, + &:enabled { + border-color: fn.color(--selected --border); + background-color: fn.color(--selected --bg); + color: fn.color(--selected --label); + + &:hover, + &:active { + border-color: fn.color(--selected --hover --border); + background-color: fn.color(--selected --bg); + color: fn.color(--selected --hover --label); + } + + @include iro.bem-at-theme('keyboard') { + &:focus { + background-color: fn.color(--selected --bg); + color: fn.color(--selected --hover --label); + } + } + } + } + + @include iro.bem-modifier('quiet') { + border-color: transparent; + background-color: transparent; + box-shadow: none; + color: fn.color(--quiet --disabled --label); + + &:link, + &:visited, + &:enabled { + border-color: transparent; + background-color: transparent; + box-shadow: none; + color: fn.color(--quiet --label); + + &:hover { + border-color: transparent; + background-color: fn.color(--quiet --hover --bg); + box-shadow: none; + color: fn.color(--quiet --hover --label); + } + + &:active { + border-color: transparent; + background-color: fn.color(--quiet --active --bg); + box-shadow: none; + color: fn.color(--quiet --active --label); + } + + @include iro.bem-at-theme('keyboard') { + &:focus { + background-color: fn.color(--quiet --hover --bg); + color: fn.color(--quiet --hover --label); + } + } + } + + @include iro.bem-is('selected') { + background-color: fn.color(--quiet --selected --bg); + color: fn.color(--quiet --disabled --label); + + &:link, + &:visited, + &:enabled { + border-color: transparent; + background-color: fn.color(--quiet --selected --bg); + box-shadow: none; + color: fn.color(--quiet --selected --label); + + &:hover, + &:active { + border-color: transparent; + background-color: fn.color(--quiet --selected --hover --bg); + box-shadow: none; + color: fn.color(--quiet --selected --hover --label); + } + + @include iro.bem-at-theme('keyboard') { + &:focus { + background-color: fn.color(--quiet --selected --bg); + color: fn.color(--quiet --selected --hover --label); + } + } + } + } + } + + @include iro.bem-at-theme('keyboard') { + &:focus { + border-color: fn.color(--key-focus --border); + box-shadow: inset 0 0 0 1px fn.color(--key-focus --border), fn.color(--key-focus --shadow); + } + } + + @include iro.bem-modifier('round') { + width: calc(1em * fn.dim(--line-height) + 2 * fn.dim(--pad-y)); + padding-right: 0; + padding-left: 0; + border-radius: 100em; + } + } +} -- cgit v1.2.3-70-g09d2