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 ++++++++++++++++++++++++++++ src/.old/objects/_action-menu.scss | 122 ++++++++++++++++ src/.old/objects/_alert.scss | 55 +++++++ src/.old/objects/_avatar.scss | 146 +++++++++++++++++++ src/.old/objects/_backdrop.scss | 33 +++++ src/.old/objects/_badge.scss | 173 ++++++++++++++++++++++ src/.old/objects/_button.scss | 179 +++++++++++++++++++++++ src/.old/objects/_checkbox.scss | 249 ++++++++++++++++++++++++++++++++ src/.old/objects/_dialog.scss | 152 +++++++++++++++++++ src/.old/objects/_emoji.scss | 74 ++++++++++ src/.old/objects/_field-label.scss | 89 ++++++++++++ src/.old/objects/_icon-nav.scss | 20 +++ src/.old/objects/_icon.scss | 26 ++++ src/.old/objects/_lightbox.scss | 206 ++++++++++++++++++++++++++ src/.old/objects/_list-group.scss | 60 ++++++++ src/.old/objects/_menu.scss | 124 ++++++++++++++++ src/.old/objects/_message.scss | 51 +++++++ src/.old/objects/_overflow-button.scss | 243 +++++++++++++++++++++++++++++++ src/.old/objects/_radio.scss | 176 ++++++++++++++++++++++ src/.old/objects/_status-indicator.scss | 35 +++++ src/.old/objects/_switch.scss | 221 ++++++++++++++++++++++++++++ src/.old/objects/_table.scss | 167 +++++++++++++++++++++ src/.old/objects/_text-field.scss | 232 +++++++++++++++++++++++++++++ 23 files changed, 3055 insertions(+) create mode 100644 src/.old/objects/_action-button.scss create mode 100644 src/.old/objects/_action-menu.scss create mode 100644 src/.old/objects/_alert.scss create mode 100644 src/.old/objects/_avatar.scss create mode 100644 src/.old/objects/_backdrop.scss create mode 100644 src/.old/objects/_badge.scss create mode 100644 src/.old/objects/_button.scss create mode 100644 src/.old/objects/_checkbox.scss create mode 100644 src/.old/objects/_dialog.scss create mode 100644 src/.old/objects/_emoji.scss create mode 100644 src/.old/objects/_field-label.scss create mode 100644 src/.old/objects/_icon-nav.scss create mode 100644 src/.old/objects/_icon.scss create mode 100644 src/.old/objects/_lightbox.scss create mode 100644 src/.old/objects/_list-group.scss create mode 100644 src/.old/objects/_menu.scss create mode 100644 src/.old/objects/_message.scss create mode 100644 src/.old/objects/_overflow-button.scss create mode 100644 src/.old/objects/_radio.scss create mode 100644 src/.old/objects/_status-indicator.scss create mode 100644 src/.old/objects/_switch.scss create mode 100644 src/.old/objects/_table.scss create mode 100644 src/.old/objects/_text-field.scss (limited to 'src/.old/objects') 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; + } + } +} diff --git a/src/.old/objects/_action-menu.scss b/src/.old/objects/_action-menu.scss new file mode 100644 index 0000000..12e3b5f --- /dev/null +++ b/src/.old/objects/_action-menu.scss @@ -0,0 +1,122 @@ +@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: fn.global-dim(--size --85), + --separator: fn.global-dim(--size --85), + --rounding: 3px, + --border: 1px, + --item: ( + --pad-x: fn.global-dim(--size --150), + --pad-y: fn.global-dim(--size --85), + ), + ), + ), 'dims'); + + @include iro.props-store(( + --colors: ( + --shadow: 0 .2em .5em rgba(#000, .1), + --border: fn.global-color(--border --stable-lo), + --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.props-store(( + --colors: ( + --shadow: 0 .2em .5em rgba(#000, .5), + ), + ), 'colors-dark'); + + @include iro.bem-object(iro.props-namespace()) { + position: absolute; + z-index: 10000; + top: 0; + left: 0; + padding: fn.dim(--pad-y) fn.dim(--pad-x); + transform: translate(var(--x), var(--y)); + border: fn.dim(--border) solid fn.color(--border); + border-radius: fn.dim(--rounding); + background-clip: padding-box; + background-color: fn.global-color(--bg); + box-shadow: fn.color(--shadow); + color: fn.global-color(--fg); + + @include iro.bem-modifier('up-left') { + transform: translate(var(--x), calc(var(--y) - 100%)); + } + + @include iro.bem-modifier('up-right') { + transform: translate(calc(var(--x) - 100%), calc(var(--y) - 100%)); + } + + @include iro.bem-modifier('down-right') { + transform: translate(calc(var(--x) - 100%), var(--y)); + } + + @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: calc(fn.dim(--rounding) - 1px); + 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: fn.foreign-dim(--icon, --size); + } + } +} diff --git a/src/.old/objects/_alert.scss b/src/.old/objects/_alert.scss new file mode 100644 index 0000000..289ef10 --- /dev/null +++ b/src/.old/objects/_alert.scss @@ -0,0 +1,55 @@ +@use 'iro-sass/src/index' as iro; +@use '../functions' as fn; + +@include iro.props-namespace('alert') { + @include iro.props-store(( + --dims: ( + --border: 1px, + --pad-x: fn.global-dim(--size --250), + --pad-y: fn.global-dim(--size --200), + --rounding: 4px, + ), + ), 'dims'); + + @include iro.props-store(( + --colors: ( + --bg: fn.global-color(--bg-hi2), + --border: fn.global-color(--fg-hi2), + --border-primary: fn.global-color(--accent --primary --solid --bg-hi), + --border-error: fn.global-color(--accent --error --solid --bg-hi), + --border-success: fn.global-color(--accent --success --solid --bg-hi), + --border-warning: fn.global-color(--accent --warning --solid --bg-hi), + ), + ), 'colors'); + + @include iro.props-store(( + --dims: ( + --pad-x: fn.global-dim(--size --200), + --pad-y: fn.global-dim(--size --150), + ), + ), 'sm'); + + @include iro.bem-object(iro.props-namespace()) { + 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.color(--bg); + color: fn.global-color(--fg); + + @include iro.bem-modifier('primary') { + border-color: fn.color(--border-primary); + } + + @include iro.bem-modifier('error') { + border-color: fn.color(--border-error); + } + + @include iro.bem-modifier('success') { + border-color: fn.color(--border-success); + } + + @include iro.bem-modifier('warning') { + border-color: fn.color(--border-warning); + } + } +} diff --git a/src/.old/objects/_avatar.scss b/src/.old/objects/_avatar.scss new file mode 100644 index 0000000..4be780e --- /dev/null +++ b/src/.old/objects/_avatar.scss @@ -0,0 +1,146 @@ +@use 'iro-sass/src/index' as iro; +@use '../functions' as fn; + +@mixin status($size) { + @include iro.bem-elem('status') { + width: fn.dim(--#{$size} --indicator-size); + height: fn.dim(--#{$size} --indicator-size); + + @include iro.bem-next-elem('content') { + mask-image: radial-gradient( + circle calc(.5 * fn.dim(--#{$size} --indicator-size) + fn.dim(--indicator-spacing)) at + calc(100% - .5 * fn.dim(--#{$size} --indicator-size)) + calc(100% - .5 * fn.dim(--#{$size} --indicator-size)), + transparent 95%, + #fff + ); + } + } +} + +@include iro.props-namespace('avatar') { + @include iro.props-store(( + --dims: ( + --400: ( + --size: fn.global-dim(--size --1600), + --font-size: fn.global-dim(--font-size --800), + --indicator-size: fn.global-dim(--size --400), + ), + --300: ( + --size: fn.global-dim(--size --1200), + --font-size: fn.global-dim(--font-size --600), + --indicator-size: fn.global-dim(--size --300), + ), + --200: ( + --size: fn.global-dim(--size --800), + --font-size: fn.global-dim(--font-size --300), + --indicator-size: fn.global-dim(--size --225), + ), + --150: ( + --size: fn.global-dim(--size --650), + --font-size: fn.global-dim(--font-size --200), + --indicator-size: fn.global-dim(--size --175), + ), + --100: ( + --size: fn.global-dim(--size --500), + --font-size: fn.global-dim(--font-size --100), + --indicator-size: fn.global-dim(--size --150), + ), + --75: ( + --size: fn.global-dim(--size --375), + --font-size: fn.global-dim(--font-size --75), + --indicator-size: fn.global-dim(--size --125), + ), + --50: ( + --size: fn.global-dim(--size --250), + --font-size: fn.global-dim(--font-size --50), + --indicator-size: fn.global-dim(--size --100), + ), + --indicator-spacing: fn.global-dim(--size --40), + --rounding: 25%, + ), + ), 'dims'); + + @include iro.props-store(( + --colors: ( + --h: 354, + --s: 44%, + --l: 45%, + + --key-focus: ( + --border: fn.global-color(--focus --fill), + --shadow: 0 0 0 calc(2px + fn.global-dim(--focus --outline-width)) fn.global-color(--accent --primary --quiet --obj-lo), + ), + ), + ), 'colors'); + + @include iro.bem-object(iro.props-namespace()) { + display: inline-block; + position: relative; + border-radius: fn.dim(--rounding); + font-size: fn.dim(--100 --font-size); + font-style: normal; + vertical-align: .05em; + + @include iro.bem-elem('status') { + position: absolute; + right: 0; + bottom: 0; + } + + @include status(100); + + @include iro.bem-elem('content') { + display: block; + width: fn.dim(--100 --size); + height: fn.dim(--100 --size); + border-radius: fn.dim(--rounding); + line-height: fn.dim(--100 --size); + text-align: center; + object-fit: cover; + object-position: center center; + } + + @include iro.bem-modifier('circle') { + border-radius: 100%; + + @include iro.bem-elem('content') { + border-radius: 100%; + } + } + + @include iro.bem-modifier('placeholder') { + @include iro.bem-elem('content') { + background-color: hsl(0, 0%, fn.color(--l)); + } + } + + @include iro.bem-modifier('colored') { + @include iro.bem-elem('content') { + background-color: hsl(fn.color(--h), fn.color(--s), fn.color(--l)); + color: #fff; + } + } + + @each $size in 50 75 150 200 300 400 { + @include iro.bem-modifier($size) { + font-size: fn.dim(--#{$size} --font-size); + + @include status($size); + + @include iro.bem-elem('content') { + width: fn.dim(--#{$size} --size); + height: fn.dim(--#{$size} --size); + line-height: fn.dim(--#{$size} --size); + } + } + } + + @include iro.bem-at-theme('keyboard') { + &:focus { + outline: 2px solid fn.color(--key-focus --border); + box-shadow: fn.color(--key-focus --shadow); + } + } + } +} diff --git a/src/.old/objects/_backdrop.scss b/src/.old/objects/_backdrop.scss new file mode 100644 index 0000000..ac23d63 --- /dev/null +++ b/src/.old/objects/_backdrop.scss @@ -0,0 +1,33 @@ +@use 'iro-sass/src/index' as iro; +@use '../functions' as fn; + +@include iro.props-namespace('backdrop') { + @include iro.props-store(( + --dims: ( + --z-index: 10000, + --blur: 2em, + ), + ), 'dims'); + + @include iro.props-store(( + --colors: ( + --bg: rgba(#000, .75), + ), + ), 'colors'); + + @include iro.bem-object(iro.props-namespace()) { + display: flex; + position: fixed; + z-index: fn.dim(--z-index); + top: 0; + right: 0; + bottom: 0; + left: 0; + box-sizing: border-box; + flex-direction: column; + overflow: auto; + background-color: fn.color(--bg); + color: fn.global-color(--fg); + backdrop-filter: blur(fn.dim(--blur)); + } +} diff --git a/src/.old/objects/_badge.scss b/src/.old/objects/_badge.scss new file mode 100644 index 0000000..0f73382 --- /dev/null +++ b/src/.old/objects/_badge.scss @@ -0,0 +1,173 @@ +@use 'iro-sass/src/index' as iro; +@use '../functions' as fn; + +@include iro.props-namespace('badge') { + @include iro.props-store(( + --dims: ( + --pad-x: fn.px-to-em(4px), + --pad-y: 0, + --rounding: 3px, + --fixed-100: 1em, + --fixed-200: 1.5em, + + --200: ( + --pad-x: fn.px-to-em(6px), + --pad-y: fn.px-to-em(2px), + ), + --300: ( + --pad-x: fn.px-to-em(10px), + --pad-y: fn.px-to-em(6px), + ), + + --pill: ( + --pad-x: fn.px-to-em(9px), + + --200: ( + --pad-x: fn.px-to-em(10px), + ), + --300: ( + --pad-x: fn.px-to-em(16px), + ), + ), + ), + ), 'dims'); + + @include iro.props-store(( + --colors: ( + --bg: fn.global-color(--obj-hi), + --label: fn.global-color(--fg-lo), + --hover: ( + --bg: fn.global-color(--obj), + ), + --active: ( + --bg: fn.global-color(--obj-lo), + ), + --key-focus: ( + --border: fn.global-color(--focus --fill), + --shadow: fn.global-color(--focus --shadow), + ), + + --primary: ( + --bg: fn.global-color(--fg-lo), + --label: fn.global-color(--bg), + --hover: ( + --bg: fn.global-color(--fg), + ), + --active: ( + --bg: fn.global-color(--fg), + ), + ), + + --accent: ( + --bg: fn.global-color(--accent --primary --solid --bg), + --label: fn.global-color(--accent --primary --solid --fg), + --hover: ( + --bg: fn.global-color(--accent --primary --solid --obj), + ), + --active: ( + --bg: fn.global-color(--accent --primary --solid --obj-lo), + ), + ), + + --accent-quiet: ( + --bg: fn.global-color(--accent --primary --quiet --bg), + --label: fn.global-color(--accent --primary --quiet --fg), + --hover: ( + --bg: fn.global-color(--accent --primary --quiet --obj), + ), + --active: ( + --bg: fn.global-color(--accent --primary --quiet --obj-lo), + ), + ) + ), + ), 'colors'); + + @include iro.bem-object(iro.props-namespace()) { + display: inline-block; + margin-top: -.5em; + margin-bottom: -.5em; + padding: fn.dim(--pad-y) fn.dim(--pad-x); + border-radius: fn.dim(--rounding); + background-color: fn.color(--bg); + color: fn.color(--label); + line-height: fn.global-dim(--font --standard --line-height); + text-align: center; + text-decoration: none; + + &:link, + &:visited, + &:enabled { + &:hover { + background-color: fn.color(--hover --bg); + } + + &:active { + background-color: fn.color(--active --bg); + } + } + + @each $variant in 'primary' 'accent' 'accent-quiet' { + @include iro.bem-modifier($variant) { + background-color: fn.color(--#{$variant} --bg); + color: fn.color(--#{$variant} --label); + + &:link, + &:visited, + &:enabled { + &:hover { + background-color: fn.color(--#{$variant} --hover --bg); + } + + &:active { + background-color: fn.color(--#{$variant} --active --bg); + } + } + } + } + + &:link, + &:visited, + &:enabled { + @include iro.bem-at-theme('keyboard') { + &:focus { + background-color: transparent; + box-shadow: inset 0 0 0 2px fn.color(--key-focus --border), fn.color(--key-focus --shadow); + color: currentColor; + } + } + } + + @include iro.bem-modifier('pill') { + padding-right: fn.dim(--pill --pad-x); + padding-left: fn.dim(--pill --pad-x); + border-radius: 10em; + } + + @each $size in '200' '300' { + @include iro.bem-modifier($size) { + padding: fn.dim(--#{$size} --pad-y) fn.dim(--#{$size} --pad-x); + + @include iro.bem-modifier('pill') { + padding-right: fn.dim(--pill --#{$size} --pad-x); + padding-left: fn.dim(--pill --#{$size} --pad-x); + } + } + } + + @include iro.bem-modifier('fixed-100') { + width: fn.dim(--fixed-100); + } + + @include iro.bem-modifier('fixed-200') { + width: fn.dim(--fixed-200); + } + + @include iro.bem-modifier('sm') { + font-size: fn.global-dim(--font-size --75); + } + + @include iro.bem-modifier('xs') { + font-size: fn.global-dim(--font-size --50); + } + } +} diff --git a/src/.old/objects/_button.scss b/src/.old/objects/_button.scss new file mode 100644 index 0000000..7cc24fa --- /dev/null +++ b/src/.old/objects/_button.scss @@ -0,0 +1,179 @@ +@use 'iro-sass/src/index' as iro; +@use '../functions' as fn; + +@mixin button-variant($variant) { + &:link, + &:visited, + &:enabled { + border-color: fn.color(--#{$variant} --bg); + background-color: fn.color(--#{$variant} --bg); + box-shadow: fn.color(--#{$variant} --shadow); + color: fn.color(--#{$variant} --label); + } + + @include iro.bem-modifier('outline') { + &:link, + &:visited, + &:enabled { + background-color: transparent; + box-shadow: none; + color: fn.color(--#{$variant} --outline-label); + } + } + + &:link, + &:visited, + &:enabled { + &:hover { + border-color: fn.color(--#{$variant} --hover --bg); + background-color: fn.color(--#{$variant} --hover --bg); + box-shadow: fn.color(--#{$variant} --hover --shadow); + color: fn.color(--#{$variant} --hover --label); + } + + &:active { + border-color: fn.color(--#{$variant} --active --bg); + background-color: fn.color(--#{$variant} --active --bg); + box-shadow: fn.color(--#{$variant} --active --shadow); + color: fn.color(--#{$variant} --active --label); + } + } +} + +@include iro.props-namespace('button') { + @include iro.props-store(( + --dims: ( + --line-height: 1.4, + --pad-x: fn.global-dim(--size --225), + --pad-y: fn.global-dim(--size --65), + --rounding: 10em, + + --lg: ( + --pad-x: fn.global-dim(--size --300), + --pad-y: fn.global-dim(--size --100), + ), + ), + ), 'dims'); + + @include iro.props-store(( + --colors: ( + --any: ( + --disabled: ( + --bg: fn.global-color(--obj-hi), + --label: fn.global-color(--fg-hi3), + --shadow: 0 0 0 0 transparent, + ), + --key-focus: ( + --bg: transparent, + --label: fn.global-color(--focus --text), + --border: fn.global-color(--focus --fill), + --shadow: fn.global-color(--focus --shadow), + ), + ), + --accent: ( + --bg: fn.global-color(--accent --primary --solid --bg), + --label: fn.global-color(--accent --primary --solid --fg), + --outline-label: fn.global-color(--accent --primary --solid --obj), + --shadow: 0 0 0 0 transparent, + + --hover: ( + --bg: fn.global-color(--accent --primary --solid --obj), + --label: fn.global-color(--accent --primary --solid --fg), + --shadow: 0 0 0 0 transparent, + ), + --active: ( + --bg: fn.global-color(--accent --primary --solid --obj-lo), + --label: fn.global-color(--accent --primary --solid --fg), + --shadow: 0 0 0 0 transparent, + ), + ), + --primary: ( + --bg: fn.global-color(--fg), + --label: fn.global-color(--bg-hi2), + --outline-label: fn.global-color(--fg), + --shadow: 0 0 0 0 transparent, + + --hover: ( + --bg: fn.global-color(--fg-lo), + --label: fn.global-color(--bg-hi2), + --shadow: 0 0 0 0 transparent, + ), + --active: ( + --bg: fn.global-color(--fg-lo), + --label: fn.global-color(--bg-hi2), + --shadow: 0 0 0 0 transparent, + ), + ), + --secondary: ( + --bg: fn.global-color(--obj-hi), + --label: fn.global-color(--fg), + --outline-label: fn.global-color(--fg), + --shadow: 0 0 0 0 transparent, + + --hover: ( + --bg: fn.global-color(--obj), + --label: fn.global-color(--fg-lo), + --shadow: 0 0 0 0 transparent, + ), + --active: ( + --bg: fn.global-color(--obj-lo), + --label: fn.global-color(--fg-lo), + --shadow: 0 0 0 0 transparent, + ), + ), + ), + ), 'colors'); + + @include iro.bem-object(iro.props-namespace()) { + display: inline-block; + padding: fn.dim(--pad-y) fn.dim(--pad-x); + border: 2px solid transparent; + border-radius: fn.dim(--rounding); + border-color: fn.color(--any --disabled --bg); + background-color: fn.color(--any --disabled --bg); + box-shadow: fn.color(--any --disabled --shadow); + color: fn.color(--any --disabled --label); + font-weight: 500; + line-height: fn.dim(--line-height); + text-align: center; + text-decoration: none; + vertical-align: top; + + @include iro.bem-modifier('block') { + display: block; + } + + @include iro.bem-modifier('outline') { + background-color: transparent; + box-shadow: none; + } + + @include iro.bem-modifier('lg') { + padding: fn.dim(--lg --pad-y) fn.dim(--lg --pad-x); + } + + @include button-variant('secondary'); + + @each $mod in 'accent' 'primary' { + @include iro.bem-modifier($mod) { + @include button-variant($mod); + } + } + + @include iro.bem-at-theme('keyboard') { + &:focus { + border-color: fn.color(--any --key-focus --border); + background-color: fn.color(--any --key-focus --bg); + box-shadow: fn.color(--any --key-focus --shadow); + color: fn.color(--any --key-focus --label); + } + } + + @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; + } + } +} diff --git a/src/.old/objects/_checkbox.scss b/src/.old/objects/_checkbox.scss new file mode 100644 index 0000000..b3bb34d --- /dev/null +++ b/src/.old/objects/_checkbox.scss @@ -0,0 +1,249 @@ +@use 'iro-sass/src/index' as iro; +@use '../functions' as fn; + +@include iro.props-namespace('checkbox') { + @include iro.props-store(( + --dims: ( + --size: fn.global-dim(--size --175), + --label-gap: fn.global-dim(--size --125), + --border: fn.global-dim(--border --medium), + --pad-x: fn.global-dim(--size --65), + --pad-y: fn.global-dim(--size --65), + ), + ), 'dims'); + + @include iro.props-store(( + --colors: ( + --box-border: fn.global-color(--fg-hi), + --box-bg: fn.global-color(--bg-hi), + + --hover: ( + --label: fn.global-color(--fg-lo), + --box-border: fn.global-color(--fg), + ), + --accent: ( + --box-border: fn.global-color(--accent --primary --solid --bg), + + --hover: ( + --box-border: fn.global-color(--accent --primary --solid --obj), + ), + ), + --key-focus: ( + --label: fn.global-color(--focus --text), + --box-border: fn.global-color(--focus --fill), + --shadow: fn.global-color(--focus --shadow), + ), + --disabled: ( + --label: fn.global-color(--fg-hi3), + --box-border: fn.global-color(--obj-lo), + --box-bg: fn.global-color(--bg-hi), + ) + ), + ), 'colors'); + + @include iro.bem-object(iro.props-namespace()) { + display: inline-flex; + position: relative; + align-items: flex-start; + margin-right: calc(-1 * fn.dim(--pad-x)); + margin-left: calc(-1 * fn.dim(--pad-x)); + padding: fn.dim(--pad-y) fn.dim(--pad-x); + + @include iro.bem-elem('box') { + display: block; + position: relative; + flex: 0 0 auto; + width: fn.dim(--size); + height: fn.dim(--size); + margin-top: calc(.5 * (fn.global-dim(--font --standard --line-height) * 1em - fn.dim(--size))); + border-radius: fn.dim(--border); + background-color: fn.color(--box-border); + + &::before, + &::after { + content: ''; + display: block; + position: absolute; + } + + &::before { + z-index: 2; + top: fn.dim(--border); + left: fn.dim(--border); + width: calc(fn.dim(--size) - 2 * fn.dim(--border)); + height: calc(fn.dim(--size) - 2 * fn.dim(--border)); + transition: transform .2s ease; + background-color: fn.color(--box-bg); + } + + &::after { + z-index: 3; + top: calc(.5 * fn.dim(--size) - 1px); + left: calc(1.5 * fn.dim(--border)); + box-sizing: border-box; + width: calc(fn.dim(--size) - 3 * fn.dim(--border)); + height: 0; + transform: scale(0); + transition: transform .2s ease; + border-width: 0 2px 2px 0; + border-style: solid; + border-radius: 2px; + border-color: fn.color(--box-bg); + } + } + + @include iro.bem-elem('check-icon') { + display: block; + position: absolute; + z-index: 2; + top: calc(1 * fn.dim(--border)); + left: calc(1 * fn.dim(--border)); + width: calc(100% - 2 * fn.dim(--border)); + height: calc(100% - 2 * fn.dim(--border)); + margin: 0; + transform: scale(0); + transform-origin: 40% 90%; + transition: transform .2s ease; + stroke-width: iro.fn-px-to-rem(3px); + color: fn.color(--box-bg); + } + + @include iro.bem-elem('label') { + align-self: baseline; + margin-left: fn.dim(--label-gap); + } + + @include iro.bem-elem('native') { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + margin: 0; + padding: 0; + overflow: hidden; + opacity: .0001; + + &:hover { + @include iro.bem-sibling-elem('label') { + color: fn.color(--hover --label); + } + + @include iro.bem-sibling-elem('box') { + background-color: fn.color(--hover --box-border); + } + } + + &:checked { + @include iro.bem-sibling-elem('box') { + &::before { + transform: scale(0); + } + + @include iro.bem-elem('check-icon') { + transform: scale(1); + } + } + } + + &:indeterminate { + @include iro.bem-sibling-elem('box') { + &::before { + transform: scale(0); + } + + &::after { + transform: scale(1); + } + + @include iro.bem-elem('check-icon') { + transform: scale(0); + } + } + } + + &:disabled { + @include iro.bem-sibling-elem('label') { + color: fn.color(--disabled --label); + } + + @include iro.bem-sibling-elem('box') { + background-color: fn.color(--disabled --box-border); + + &::before { + background-color: fn.color(--disabled --box-bg); + } + } + } + + @include iro.bem-at-theme('keyboard') { + &:focus { + @include iro.bem-sibling-elem('label') { + color: fn.color(--key-focus --label); + } + + @include iro.bem-sibling-elem('box') { + background-color: fn.color(--key-focus --box-border); + box-shadow: fn.color(--key-focus --shadow); + } + } + } + } + + @include iro.bem-modifier('standalone') { + @include iro.bem-elem('box') { + margin-top: 0; + } + } + + @include iro.bem-modifier('accent') { + @include iro.bem-elem('native') { + &:checked { + @include iro.bem-sibling-elem('box') { + background-color: fn.color(--accent --box-border); + } + + &:hover { + @include iro.bem-sibling-elem('box') { + background-color: fn.color(--accent --hover --box-border); + } + } + } + + &:indeterminate { + @include iro.bem-sibling-elem('box') { + background-color: fn.color(--accent --box-border); + } + + &:hover { + @include iro.bem-sibling-elem('box') { + background-color: fn.color(--accent --hover --box-border); + } + } + } + + &:disabled { + @include iro.bem-sibling-elem('box') { + background-color: fn.color(--disabled --box-border); + + &::before { + background-color: fn.color(--disabled --box-bg); + } + } + + &:checked { + @include iro.bem-sibling-elem('box') { + background-color: fn.color(--disabled --box-border); + } + } + + &:indeterminate { + @include iro.bem-sibling-elem('box') { + background-color: fn.color(--disabled --box-border); + } + } + } + } + } + } +} diff --git a/src/.old/objects/_dialog.scss b/src/.old/objects/_dialog.scss new file mode 100644 index 0000000..9333ce6 --- /dev/null +++ b/src/.old/objects/_dialog.scss @@ -0,0 +1,152 @@ +@use 'iro-sass/src/index' as iro; +@use '../functions' as fn; + +@include iro.props-namespace('dialog') { + @include iro.props-store(( + --dims: ( + --width-sm: iro.fn-px-to-rem(500px), + --width-md: iro.fn-px-to-rem(800px), + --width-lg: iro.fn-px-to-rem(1100px), + --rounding: 4px, + --border: 1px, + + --header: ( + --pad-x: fn.global-dim(--size --75), + --pad-y: fn.global-dim(--size --75), + ), + + --sidebar: ( + --pad-x: fn.global-dim(--size --75), + --pad-y: fn.global-dim(--size --75), + ), + + --body: ( + --pad-x: fn.global-dim(--size --200), + --pad-y: fn.global-dim(--size --200), + ) + ), + ), 'dims'); + + @include iro.props-store(( + --dims: ( + --pad-x: fn.global-dim(--size --300), + --pad-y: fn.global-dim(--size --300), + ), + ), 'md'); + + @include iro.props-store(( + --colors: ( + --border: fn.global-color(--border --stable), + ), + ), 'colors'); + + @include iro.bem-object(iro.props-namespace()) { + display: grid; + grid-template-rows: auto auto 1fr auto auto; + grid-template-columns: auto 1fr; + grid-template-areas: + 'sidebar-header header' + 'sidebar top' + 'sidebar body' + 'sidebar bottom' + 'sidebar footer'; + position: relative; + box-sizing: border-box; + flex: 0 0 auto; + width: 100%; + max-width: fn.dim(--width-md); + margin: 0 auto; + overflow: hidden; + border-radius: fn.dim(--rounding); + background-clip: padding-box; + background-color: fn.global-color(--bg); + color: fn.global-color(--fg); + + @include iro.bem-modifier('sm') { + max-width: fn.dim(--width-sm); + } + + @include iro.bem-modifier('lg') { + max-width: fn.dim(--width-lg); + } + + @include iro.bem-elem('header') { + grid-area: sidebar-header / sidebar-header / header / header; + padding: fn.dim(--header --pad-y) fn.dim(--header --pad-x); + + @include iro.bem-modifier('sidebar') { + grid-area: sidebar-header; + border-right: 1px solid fn.color(--border); + + @include iro.bem-sibling-elem('header') { + grid-area: header; + } + } + } + + @include iro.bem-elem('title') { + margin-top: 0; + padding-right: calc(fn.dim(--body --pad-x) - fn.dim(--header --pad-x)); + padding-left: calc(fn.dim(--body --pad-x) - fn.dim(--header --pad-x)); + } + + @include iro.bem-elem('close-btn') { + margin-left: auto; + } + + @include iro.bem-elem('sidebar') { + grid-area: sidebar; + padding: fn.dim(--sidebar --pad-y) fn.dim(--sidebar --pad-x); + overflow: auto; + border-right: 1px solid fn.color(--border); + } + + @include iro.bem-elem('top') { + grid-area: top; + min-width: 0; + padding: fn.dim(--body --pad-y) fn.dim(--body --pad-x); + + @include iro.bem-sibling-elem('body') { + padding-top: 0; + } + } + + @include iro.bem-elem('bottom') { + grid-area: bottom; + min-width: 0; + padding: fn.dim(--body --pad-y) fn.dim(--body --pad-x); + + @include iro.bem-sibling-elem('body') { + padding-bottom: 0; + } + } + + @include iro.bem-elem('body') { + grid-area: body; + min-width: 0; + min-height: 0; + padding: fn.dim(--body --pad-y) fn.dim(--body --pad-x); + } + + @include iro.bem-elem('footer') { + grid-area: footer; + justify-content: flex-end; + padding: fn.dim(--body --pad-y) fn.dim(--body --pad-x); + } + + @include iro.bem-modifier('scrollable') { + flex-shrink: 1; + + @include iro.bem-elem('body') { + overflow: auto; + scrollbar-color: fn.global-color(--obj-lo) transparent; + } + } + + @include iro.bem-modifier('flat') { + @include iro.bem-elem('body') { + padding-top: 0; + } + } + } +} diff --git a/src/.old/objects/_emoji.scss b/src/.old/objects/_emoji.scss new file mode 100644 index 0000000..8d17212 --- /dev/null +++ b/src/.old/objects/_emoji.scss @@ -0,0 +1,74 @@ +@use 'iro-sass/src/index' as iro; +@use '../functions' as fn; +@use 'sass:math'; + +@include iro.props-namespace('emoji') { + @include iro.props-store(( + --dims: ( + --size: calc(1 / 14 * 18em), + --pad: .3em, + --rounding: 3px, + --zoom: 3, + --valign: -.25em, + + --125: ( + --size: calc(1 / 14 * 23em), + --valign: -.45em, + ), + + --150: ( + --size: calc(1 / 14 * 28em), + --valign: -.65em, + ), + + --200: ( + --size: calc(1 / 14 * 38em), + --valign: -1em, + ) + ) + ), 'dims'); + + @include iro.props-store(( + --colors: ( + --bg: fn.global-color(--obj-hi), + ) + ), 'colors'); + + @include iro.bem-object(iro.props-namespace()) { + display: inline-block; + position: relative; + width: calc(fn.dim(--size)); + height: calc(fn.dim(--size)); + margin: calc(-1 * fn.dim(--pad)); + padding: calc(fn.dim(--pad)); + vertical-align: fn.dim(--valign); + object-fit: contain; + + @include iro.bem-modifier('icon') { + margin: calc(-1 * fn.dim(--pad) - .5 * (fn.dim(--size) - fn.foreign-dim(--icon, --size))); + vertical-align: fn.foreign-dim(--icon, --valign); + } + + @each $size in '125' '150' '200' { + @include iro.bem-modifier($size) { + width: fn.dim(--#{$size} --size); + height: fn.dim(--#{$size} --size); + vertical-align: fn.dim(--#{$size} --valign); + + @include iro.bem-modifier('icon') { + margin: calc(-1 * fn.dim(--pad) - .5 * (fn.dim(--#{$size} --size) - fn.foreign-dim(--icon, --size))); + } + } + } + + @include iro.bem-modifier('zoomable') { + transition: transform .2s ease, background-color .2s ease; + border-radius: calc(fn.dim(--rounding) / fn.dim(--zoom)); + + &:hover { + transform: scale(fn.dim(--zoom)); + background-color: fn.color(--bg); + } + } + } +} diff --git a/src/.old/objects/_field-label.scss b/src/.old/objects/_field-label.scss new file mode 100644 index 0000000..2127a09 --- /dev/null +++ b/src/.old/objects/_field-label.scss @@ -0,0 +1,89 @@ +@use 'iro-sass/src/index' as iro; +@use '../functions' as fn; + +@include iro.props-namespace('field-label') { + @include iro.props-store(( + --dims: ( + --spacing-x: fn.global-dim(--size --150), + --spacing-y: fn.global-dim(--size --85), + --label-font-size: fn.global-dim(--font-size --75), + --hint-font-size: fn.global-dim(--font-size --75), + ), + ), 'dims'); + + @include iro.props-store(( + --colors: ( + --label: fn.global-color(--fg-hi), + --hint: fn.global-color(--fg-hi), + --error-hint: fn.global-color(--accent --error --quiet --fg), + --disabled: fn.global-color(--fg-hi3), + ), + ), 'colors'); + + @include iro.bem-object(iro.props-namespace()) { + display: block; + + @include iro.bem-elem('label') { + display: block; + flex: 0 0 auto; + padding-right: fn.dim(--spacing-x); + color: fn.color(--label); + font-size: fn.dim(--label-font-size); + font-weight: 400; + line-height: 1.3; + + @include iro.bem-next-elem('content') { + margin-top: fn.dim(--spacing-y); + } + } + + @include iro.bem-elem('content') { + display: block; + width: 100%; + } + + @include iro.bem-elem('hint') { + display: block; + margin-top: fn.dim(--spacing-y); + color: fn.color(--hint); + font-size: fn.dim(--hint-font-size); + } + + @include iro.bem-is('invalid') { + @include iro.bem-elem('hint') { + color: fn.color(--error-hint); + } + } + + @include iro.bem-is('disabled') { + @include iro.bem-elem('label', 'hint') { + color: fn.color(--disabled); + } + } + + @include iro.bem-modifier('left', 'right') { + display: flex; + align-items: baseline; + + @include iro.bem-elem('label') { + display: inline-block; + + @include iro.bem-next-elem('content') { + margin-top: 0; + } + } + } + + @include iro.bem-modifier('left') { + @include iro.bem-elem('label') { + text-align: left; + } + } + + @include iro.bem-modifier('right') { + @include iro.bem-elem('label') { + text-align: right; + } + } + } +} diff --git a/src/.old/objects/_icon-nav.scss b/src/.old/objects/_icon-nav.scss new file mode 100644 index 0000000..d1c6539 --- /dev/null +++ b/src/.old/objects/_icon-nav.scss @@ -0,0 +1,20 @@ +@use 'iro-sass/src/index' as iro; +@use '../functions' as fn; + +@include iro.props-namespace('icon-nav') { + @include iro.props-store(( + --dims: ( + --spacing: fn.global-dim(--size --100), + ) + ), 'dims'); + + @include iro.bem-object(iro.props-namespace()) { + display: flex; + align-items: center; + gap: fn.dim(--spacing); + + @include iro.bem-modifier('vertical') { + flex-direction: column; + } + } +} diff --git a/src/.old/objects/_icon.scss b/src/.old/objects/_icon.scss new file mode 100644 index 0000000..5c4bfab --- /dev/null +++ b/src/.old/objects/_icon.scss @@ -0,0 +1,26 @@ +@use 'iro-sass/src/index' as iro; +@use '../functions' as fn; + +@include iro.props-namespace('icon') { + @include iro.props-store(( + --dims: ( + --stroke: 1.5px, + --size: calc(1 / 14 * 16em), + --valign: -.2em, + ) + ), 'dims'); + + @include iro.bem-object(iro.props-namespace()) { + display: inline; + width: fn.dim(--size); + height: fn.dim(--size); + stroke-width: fn.dim(--stroke); + stroke-linecap: round; + stroke-linejoin: round; + vertical-align: fn.dim(--valign); + + @include iro.bem-modifier('block') { + display: block; + } + } +} diff --git a/src/.old/objects/_lightbox.scss b/src/.old/objects/_lightbox.scss new file mode 100644 index 0000000..31d3398 --- /dev/null +++ b/src/.old/objects/_lightbox.scss @@ -0,0 +1,206 @@ +@use 'iro-sass/src/index' as iro; +@use '../functions' as fn; + +@use 'action-button'; + +@include iro.props-namespace('lightbox') { + @include iro.props-store(( + --dims: ( + --pad: fn.global-dim(--size --150), + --thumbnail: ( + --size: fn.global-dim(--size --700), + --spacing: fn.global-dim(--size --100), + --idle: 1px, + --selected: 2px, + ), + --close-button: ( + --font-size: fn.global-dim(--font-size --200), + ), + --nav-button: ( + --width: fn.global-dim(--size --3800), + --height: fn.global-dim(--size --3800), + --font-size: fn.global-dim(--font-size --200), + ), + ), + ), 'dims'); + + @include iro.props-store(( + --dims: ( + --thumbnail: ( + --size: fn.global-dim(--size --600), + ), + --nav-button: ( + --width: fn.global-dim(--size --2500), + --height: fn.global-dim(--size --2500), + ), + ), + ), 'md'); + + @include iro.props-store(( + --colors: ( + --thumbnail: ( + --idle: fn.global-color(--fg-hi2), + --selected: fn.global-color(--fg-lo), + ), + ), + ), 'colors'); + + @include iro.bem-object(iro.props-namespace()) { + display: grid; + grid-template-rows: auto minmax(0, 1fr) auto auto; + grid-template-columns: auto minmax(0, 1fr) auto; + grid-template-areas: + 'header header header' + 'prev content next' + 'thumbnails thumbnails thumbnails' + 'footer footer footer'; + box-sizing: border-box; + height: 100%; + overflow: hidden; + + @include iro.bem-elem('header') { + grid-area: header; + display: flex; + align-items: flex-start; + padding: fn.dim(--pad) fn.dim(--pad) 0; + } + + @include iro.bem-elem('img') { + display: none; + box-sizing: border-box; + grid-area: content; + width: 100%; + height: 100%; + padding: fn.dim(--pad); + object-fit: scale-down; + + @include iro.bem-sibling-elem('img') { + @include iro.bem-modifier('default') { + display: block; + + @include iro.bem-next-elem('nav-btn') { + display: block; + + @include iro.bem-next-elem('nav-btn') { + display: block; + } + } + } + } + + @include iro.bem-multi('&:target', 'is' 'visible') { + display: block; + + @include iro.bem-next-elem('nav-btn') { + display: block; + + @include iro.bem-next-elem('nav-btn') { + display: block; + } + } + + @include iro.bem-sibling-elem('img') { + @include iro.bem-modifier('default') { + display: none; + + @include iro.bem-next-elem('nav-btn') { + display: none; + + @include iro.bem-next-elem('nav-btn') { + display: none; + } + } + } + } + } + } + + @include iro.bem-elem('thumbnails') { + grid-area: thumbnails; + display: flex; + gap: fn.dim(--thumbnail --spacing); + padding: fn.dim(--thumbnail --selected) fn.dim(--pad) fn.dim(--pad); + overflow: auto; + } + + @include iro.bem-elem('footer') { + grid-area: footer; + display: flex; + align-items: flex-start; + padding: 0 fn.dim(--pad) fn.dim(--pad); + } + + @include iro.bem-elem('thumbnail') { + position: relative; + flex: 0 0 auto; + width: fn.dim(--thumbnail --size); + height: fn.dim(--thumbnail --size); + opacity: .75; + box-shadow: 0 0 0 fn.dim(--thumbnail --idle) fn.color(--thumbnail --idle) inset; + + &:hover { + opacity: 1; + } + + @include iro.bem-is('selected') { + opacity: 1; + box-shadow: 0 0 0 fn.dim(--thumbnail --selected) fn.color(--thumbnail --selected); + } + } + + @include iro.bem-elem('thumbnail-img') { + display: block; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + object-fit: cover; + object-position: center center; + } + + @include iro.bem-elem('thumbnail-icon') { + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + } + + @include iro.bem-elem('close-btn') { + flex: 0 0 auto; + margin: calc(-.5 * fn.dim(--pad)) calc(-.5 * fn.dim(--pad)) 0 auto; + font-size: fn.dim(--close-button --font-size); + } + + @include iro.bem-elem('nav-btn') { + display: none; + position: relative; + align-self: center; + overflow: visible; + font-size: fn.dim(--nav-button --font-size); + + &::after { + content: ''; + display: block; + position: absolute; + top: 50%; + left: 50%; + width: fn.dim(--nav-button --width); + height: fn.dim(--nav-button --height); + transform: translate(-50%, -50%); + } + + @include iro.bem-modifier('prev') { + grid-area: prev; + margin-right: calc(-1 * fn.dim(--pad)); + margin-left: calc(.5 * fn.dim(--pad)); + } + + @include iro.bem-modifier('next') { + grid-area: next; + margin-right: calc(.5 * fn.dim(--pad)); + margin-left: calc(-1 * fn.dim(--pad)); + } + } + } +} diff --git a/src/.old/objects/_list-group.scss b/src/.old/objects/_list-group.scss new file mode 100644 index 0000000..d46722e --- /dev/null +++ b/src/.old/objects/_list-group.scss @@ -0,0 +1,60 @@ +@use 'iro-sass/src/index' as iro; +@use '../functions' as fn; + +@include iro.props-namespace('list-group') { + @include iro.props-store(( + --dims: ( + --pad-x: fn.global-dim(--size --175), + --pad-y: fn.global-dim(--size --125), + --rounding: 3px, + ), + ), 'dims'); + + @include iro.props-store(( + --colors: ( + --bg: fn.global-color(--bg-hi2), + --border: fn.global-color(--obj), + --hover: fn.global-color(--bg), + --press: fn.global-color(--obj-hi), + ) + ), 'colors'); + + @include iro.bem-object(iro.props-namespace()) { + border: 1px solid fn.color(--border); + border-radius: fn.dim(--rounding); + background-color: fn.color(--bg); + + @include iro.bem-elem('item') { + padding: fn.dim(--pad-y) fn.dim(--pad-x); + + @include iro.bem-next-twin-elem { + border-width: 1px 0 0; + border-style: solid; + border-color: fn.color(--border); + } + + @include iro.bem-multi('&:link, &:visited, &:enabled', 'modifier' 'interactive') { + &:hover { + background-color: fn.color(--hover); + } + + &:active { + background-color: fn.color(--press); + } + } + } + + @include iro.bem-modifier('horizontal') { + display: flex; + + @include iro.bem-elem('item') { + flex: 1 0 auto; + + @include iro.bem-next-twin-elem { + border-top-width: 0; + border-left-width: 1px; + } + } + } + } +} diff --git a/src/.old/objects/_menu.scss b/src/.old/objects/_menu.scss new file mode 100644 index 0000000..7db4896 --- /dev/null +++ b/src/.old/objects/_menu.scss @@ -0,0 +1,124 @@ +@use 'iro-sass/src/index' as iro; +@use '../functions' as fn; + +@use './icon'; + +@include iro.props-namespace('menu') { + @include iro.props-store(( + --dims: ( + --spacing: fn.global-dim(--size --50), + --header: ( + --font-size: fn.global-dim(--font-size --50), + ), + --separator: fn.global-dim(--size --200), + --item: ( + --pad-x: fn.global-dim(--size --150), + --pad-y: fn.global-dim(--size --100), + --rounding: 3px, + ), + ), + ), 'dims'); + + @include iro.props-store(( + --colors: ( + --header: ( + --label: 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: ( + --border: fn.global-color(--focus --fill), + --shadow: fn.global-color(--focus --shadow), + ), + --badge: ( + --bg: fn.global-color(--bg), + --label: fn.global-color(--fg-lo), + ) + ), + ), + ), 'colors'); + + @include iro.bem-object(iro.props-namespace()) { + display: flex; + flex-direction: column; + gap: fn.dim(--spacing); + + @include iro.bem-elem('header') { + padding: fn.dim(--item --pad-y) fn.dim(--item --pad-x); + color: fn.color(--header --label); + font-size: fn.dim(--header --font-size); + font-weight: 500; + letter-spacing: .5px; + text-transform: uppercase; + + @include iro.bem-next-twin-elem { + margin-top: calc(fn.dim(--separator) + fn.dim(--spacing)); + } + } + + @include iro.bem-elem('item') { + padding: calc(fn.dim(--item --pad-y) - 2px) calc(fn.dim(--item --pad-x) - 2px); + border: 2px solid transparent; + border-radius: fn.dim(--item --rounding); + color: fn.color(--item --disabled --label); + + &:link, + &:visited, + &:enabled { + color: currentColor; + + @include iro.bem-multi('&:hover, &:active', 'is' 'selected') { + background-color: fn.color(--item --hover --bg); + color: fn.color(--item --hover --label); + + @include iro.bem-elem('badge') { + background-color: fn.color(--item --badge --bg); + color: fn.color(--item --badge --label); + } + } + + @include iro.bem-at-theme('keyboard') { + &:focus { + border-radius: calc(fn.dim(--item --rounding) - 1px); + border-color: fn.color(--item --key-focus --border); + background-color: fn.color(--item --hover --bg); + box-shadow: fn.color(--item --key-focus --shadow); + color: fn.color(--item --hover --label); + } + } + } + + @include iro.bem-next-elem('header') { + margin-top: 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') { + height: fn.dim(--separator); + } + + @include iro.bem-elem('icon-slot') { + display: flex; + justify-content: center; + width: fn.foreign-dim(--icon, --size); + } + + @include iro.bem-modifier('pull') { + margin: calc(-1 * fn.dim(--item --pad-x)); + } + } +} diff --git a/src/.old/objects/_message.scss b/src/.old/objects/_message.scss new file mode 100644 index 0000000..283ce26 --- /dev/null +++ b/src/.old/objects/_message.scss @@ -0,0 +1,51 @@ +@use 'iro-sass/src/index' as iro; +@use '../functions' as fn; + +@include iro.props-namespace('message') { + @include iro.props-store(( + --dims: ( + --bubble: ( + --pad-x: fn.global-dim(--size --200), + --pad-y: fn.global-dim(--size --150), + --rounding: 0, + + --75: ( + --pad-x: fn.global-dim(--size --150), + --pad-y: fn.global-dim(--size --85), + ), + ), + ) + ), 'dims'); + + @include iro.props-store(( + --colors: ( + --highlight: fn.global-color(--fg-lo), + ), + ), 'colors'); + + @include iro.bem-object(iro.props-namespace()) { + @include iro.bem-elem('suffix') { + margin-left: 1em; + float: right; + } + + @include iro.bem-modifier('bubble') { + padding: fn.dim(--bubble --pad-y) fn.dim(--bubble --pad-x); + border-radius: fn.dim(--bubble --rounding); + background-color: fn.global-color(--bg); + color: fn.global-color(--fg); + + @include iro.bem-elem('suffix') { + transform: translate(.2em, .2em); + } + + @include iro.bem-modifier('highlight') { + box-shadow: -3px 0 0 0 fn.color(--highlight); + } + + @include iro.bem-modifier('75') { + padding: fn.dim(--bubble --75 --pad-y) fn.dim(--bubble --75 --pad-x); + } + } + } +} diff --git a/src/.old/objects/_overflow-button.scss b/src/.old/objects/_overflow-button.scss new file mode 100644 index 0000000..b15ea1f --- /dev/null +++ b/src/.old/objects/_overflow-button.scss @@ -0,0 +1,243 @@ +@use 'iro-sass/src/index' as iro; +@use '../functions' as fn; + +@include iro.props-namespace('overflow-button') { + @include iro.props-store(( + --dims: ( + --pad-x: calc(fn.global-dim(--size --125) - 1px), + --pad-y: calc(fn.global-dim(--size --125) - 1px), + --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: ( + --bg: fn.global-color(--obj), + --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), + ), + + --red: ( + --hover: ( + --bg: fn.global-color(--red --quiet --bg), + --label: fn.global-color(--red --quiet --fg), + ), + --active: ( + --bg: fn.global-color(--red --quiet --obj), + --label: fn.global-color(--red --quiet --fg-lo), + ), + + --selected: ( + --bg: fn.global-color(--red --quiet --bg), + --label: fn.global-color(--red --quiet --fg), + + --hover: ( + --bg: fn.global-color(--red --quiet --obj), + --label: fn.global-color(--red --quiet --fg-lo), + ), + ), + ), + + --blue: ( + --hover: ( + --bg: fn.global-color(--blue --quiet --bg), + --label: fn.global-color(--blue --quiet --fg), + ), + --active: ( + --bg: fn.global-color(--blue --quiet --obj), + --label: fn.global-color(--blue --quiet --fg-lo), + ), + + --selected: ( + --bg: fn.global-color(--blue --quiet --bg), + --label: fn.global-color(--blue --quiet --fg), + + --hover: ( + --bg: fn.global-color(--blue --quiet --obj), + --label: fn.global-color(--blue --quiet --fg-lo), + ), + ), + ), + + --green: ( + --hover: ( + --bg: fn.global-color(--green --quiet --bg), + --label: fn.global-color(--green --quiet --fg), + ), + --active: ( + --bg: fn.global-color(--green --quiet --obj), + --label: fn.global-color(--green --quiet --fg-lo), + ), + + --selected: ( + --bg: fn.global-color(--green --quiet --bg), + --label: fn.global-color(--green --quiet --fg), + + --hover: ( + --bg: fn.global-color(--green --quiet --obj), + --label: fn.global-color(--green --quiet --fg-lo), + ), + ), + ) + ), + ), 'colors'); + + @include iro.bem-object(iro.props-namespace()) { + display: inline-block; + color: fn.color(--disabled --label); + + @include iro.bem-elem('outside') { + display: inline-block; + margin-right: fn.dim(--spacing); + } + + @include iro.bem-elem('inside') { + display: inline-block; + padding: fn.dim(--pad-y) fn.dim(--pad-x); + border: 2px solid transparent; + border-radius: 100em; + line-height: 1; + text-align: center; + text-decoration: none; + text-overflow: ellipsis; + white-space: nowrap; + + @include iro.bem-next-elem('outside') { + margin-right: 0; + margin-left: fn.dim(--spacing); + } + } + + &:link, + &:visited, + &:enabled { + 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') { + @include iro.bem-elem('inside') { + background-color: fn.color(--selected --bg); + } + + &:link, + &:visited, + &:enabled { + @include iro.bem-elem('inside') { + color: fn.color(--selected --label); + } + + &:hover, + &:active { + @include iro.bem-elem('inside') { + background-color: fn.color(--selected --hover --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); + } + } + } + } + } + + @each $color in 'red' 'blue' 'green' { + @include iro.bem-modifier($color) { + &:link, + &:visited, + &:enabled { + &:hover { + @include iro.bem-elem('inside') { + background-color: fn.color(--#{$color} --hover --bg); + color: fn.color(--#{$color} --hover --label); + } + } + + &:active { + @include iro.bem-elem('inside') { + background-color: fn.color(--#{$color} --active --bg); + color: fn.color(--#{$color} --active --label); + } + } + } + + @include iro.bem-is('selected') { + &:link, + &:visited, + &:enabled { + @include iro.bem-elem('inside') { + background-color: fn.color(--#{$color} --selected --bg); + color: fn.color(--#{$color} --selected --label); + } + + &:hover, + &:active { + @include iro.bem-elem('inside') { + background-color: fn.color(--#{$color} --selected --hover --bg); + color: fn.color(--#{$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: fn.color(--key-focus --shadow); + } + } + } + } +} diff --git a/src/.old/objects/_radio.scss b/src/.old/objects/_radio.scss new file mode 100644 index 0000000..5af7a12 --- /dev/null +++ b/src/.old/objects/_radio.scss @@ -0,0 +1,176 @@ +@use 'iro-sass/src/index' as iro; +@use '../functions' as fn; + +@include iro.props-namespace('radio') { + @include iro.props-store(( + --dims: ( + --diameter: calc(fn.global-dim(--size --175) + 1px), + --label-gap: fn.global-dim(--size --125), + --border: fn.global-dim(--border --medium), + --pad-x: fn.global-dim(--size --65), + --pad-y: fn.global-dim(--size --65), + ), + ), 'dims'); + + @include iro.props-store(( + --colors: ( + --circle-border: fn.global-color(--fg-hi), + --circle-bg: fn.global-color(--bg-hi), + + --hover: ( + --label: fn.global-color(--fg-lo), + --circle-border: fn.global-color(--fg), + ), + --accent: ( + --circle-border: fn.global-color(--accent --primary --solid --bg), + + --hover: ( + --circle-border: fn.global-color(--accent --primary --solid --obj), + ), + ), + --key-focus: ( + --label: fn.global-color(--focus --text), + --circle-border: fn.global-color(--focus --fill), + --shadow: fn.global-color(--focus --shadow), + ), + --disabled: ( + --label: fn.global-color(--fg-hi3), + --circle-border: fn.global-color(--obj-lo), + --circle-bg: fn.global-color(--bg-hi), + ) + ), + ), 'colors'); + + @include iro.bem-object(iro.props-namespace()) { + display: inline-flex; + position: relative; + align-items: flex-start; + margin-right: calc(-1 * fn.dim(--pad-x)); + margin-left: calc(-1 * fn.dim(--pad-x)); + padding: fn.dim(--pad-y) fn.dim(--pad-x); + + @include iro.bem-elem('circle') { + display: block; + box-sizing: border-box; + flex: 0 0 auto; + width: fn.dim(--diameter); + height: fn.dim(--diameter); + margin-top: calc(.5 * (fn.global-dim(--font --standard --line-height) * 1em - fn.dim(--diameter))); + border-radius: 2em; + background-color: fn.color(--circle-border); + + &::after { + content: ''; + display: block; + position: relative; + top: fn.dim(--border); + left: fn.dim(--border); + width: calc(fn.dim(--diameter) - 2 * fn.dim(--border)); + height: calc(fn.dim(--diameter) - 2 * fn.dim(--border)); + transition: transform .2s ease; + border-radius: fn.dim(--diameter); + background-color: fn.color(--circle-bg); + } + } + + @include iro.bem-elem('label') { + align-self: baseline; + margin-left: fn.dim(--label-gap); + } + + @include iro.bem-elem('native') { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + margin: 0; + padding: 0; + overflow: hidden; + opacity: .0001; + + &:hover { + @include iro.bem-sibling-elem('label') { + color: fn.color(--hover --label); + } + + @include iro.bem-sibling-elem('circle') { + background-color: fn.color(--hover --circle-border); + } + } + + &:checked { + @include iro.bem-sibling-elem('circle') { + &::after { + transform: scale(.44); + } + } + } + + &:disabled { + @include iro.bem-sibling-elem('label') { + color: fn.color(--disabled --label); + } + + @include iro.bem-sibling-elem('circle') { + background-color: fn.color(--disabled --circle-border); + + &::after { + background-color: fn.color(--disabled --circle-bg); + } + } + } + + @include iro.bem-at-theme('keyboard') { + &:focus { + @include iro.bem-sibling-elem('label') { + color: fn.color(--key-focus --label); + } + + @include iro.bem-sibling-elem('circle') { + background-color: fn.color(--key-focus --circle-border); + box-shadow: fn.color(--key-focus --shadow); + } + } + } + } + + @include iro.bem-modifier('standalone') { + @include iro.bem-elem('circle') { + margin-top: 0; + } + } + + @include iro.bem-modifier('accent') { + @include iro.bem-elem('native') { + &:checked { + @include iro.bem-sibling-elem('circle') { + background-color: fn.color(--accent --circle-border); + } + + &:hover { + @include iro.bem-sibling-elem('circle') { + background-color: fn.color(--accent --hover --circle-border); + } + } + } + + &:disabled { + @include iro.bem-sibling-elem('circle') { + background-color: fn.color(--disabled --circle-border); + + &::after { + background-color: fn.color(--disabled --circle-bg); + } + } + + &:checked { + @include iro.bem-sibling-elem('circle') { + background-color: fn.color(--disabled --circle-border); + } + } + } + } + } + } +} diff --git a/src/.old/objects/_status-indicator.scss b/src/.old/objects/_status-indicator.scss new file mode 100644 index 0000000..d8ea9ef --- /dev/null +++ b/src/.old/objects/_status-indicator.scss @@ -0,0 +1,35 @@ +@use 'iro-sass/src/index' as iro; +@use '../functions' as fn; + +@include iro.props-namespace('status-indicator') { + @include iro.props-store(( + --dims: ( + --size: fn.global-dim(--size --125), + ), + ), 'dims'); + + @include iro.props-store(( + --colors: ( + --default: fn.global-color(--obj-lo), + --primary: fn.global-color(--fg), + --green: fn.global-color(--green --solid --bg-hi), + --yellow: fn.global-color(--yellow --solid --bg-hi), + --red: fn.global-color(--red --solid --bg-hi), + ), + ), 'colors'); + + @include iro.bem-object(iro.props-namespace()) { + display: inline-block; + width: fn.dim(--size); + height: fn.dim(--size); + border-radius: 10em; + background-color: fn.color(--default); + vertical-align: middle; + + @each $color in 'primary' 'green' 'yellow' 'red' { + @include iro.bem-is($color) { + background-color: fn.color(--#{$color}); + } + } + } +} diff --git a/src/.old/objects/_switch.scss b/src/.old/objects/_switch.scss new file mode 100644 index 0000000..cbbb9b7 --- /dev/null +++ b/src/.old/objects/_switch.scss @@ -0,0 +1,221 @@ +@use 'iro-sass/src/index' as iro; +@use '../functions' as fn; + +@include iro.props-namespace('switch') { + @include iro.props-store(( + --dims: ( + --width: fn.global-dim(--size --325), + --height: calc(fn.global-dim(--size --175) + 1px), + --label-gap: fn.global-dim(--size --125), + --border: fn.global-dim(--border --medium), + --pad-x: fn.global-dim(--size --65), + --pad-y: fn.global-dim(--size --65), + ), + ), 'dims'); + + @include iro.props-store(( + --colors: ( + --track-bg: fn.global-color(--obj), + --handle-border: fn.global-color(--fg-hi), + --handle-bg: fn.global-color(--bg-hi), + + --hover: ( + --label: fn.global-color(--fg-lo), + --handle-border: fn.global-color(--fg), + ), + --accent: ( + --handle-border: fn.global-color(--accent --primary --solid --bg), + + --hover: ( + --handle-border: fn.global-color(--accent --primary --solid --obj), + ), + ), + --key-focus: ( + --label: fn.global-color(--focus --text), + --track-bg: fn.global-color(--focus --fill), + --handle-border: fn.global-color(--focus --fill), + --shadow: fn.global-color(--focus --shadow), + ), + --disabled: ( + --label: fn.global-color(--fg-hi3), + --track-bg: fn.global-color(--obj), + --handle-border: fn.global-color(--obj-lo), + --handle-bg: fn.global-color(--bg-hi), + ) + ), + ), 'colors'); + + @include iro.bem-object(iro.props-namespace()) { + display: inline-flex; + position: relative; + align-items: flex-start; + margin-right: calc(-1 * fn.dim(--pad-x)); + margin-left: calc(-1 * fn.dim(--pad-x)); + padding: fn.dim(--pad-y) fn.dim(--pad-x); + + @include iro.bem-elem('indicator') { + display: block; + box-sizing: border-box; + flex: 0 0 auto; + width: fn.dim(--width); + height: fn.dim(--height); + margin-top: calc(.5 * (fn.global-dim(--font --standard --line-height) * 1em - fn.dim(--height))); + transition: background-color .2s ease; + border-radius: 2em; + background-color: fn.color(--track-bg); + + &::after { + content: ''; + display: block; + width: calc(fn.dim(--height) - 2 * fn.dim(--border)); + height: calc(fn.dim(--height) - 2 * fn.dim(--border)); + transition: transform .2s ease; + border: fn.dim(--border) solid fn.color(--handle-border); + border-radius: fn.dim(--width); + background-color: fn.color(--handle-bg); + } + } + + @include iro.bem-elem('label') { + align-self: baseline; + margin-left: fn.dim(--label-gap); + } + + @include iro.bem-elem('native') { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + margin: 0; + padding: 0; + overflow: hidden; + opacity: .0001; + + &:hover { + @include iro.bem-sibling-elem('label') { + color: fn.color(--hover --label); + } + + @include iro.bem-sibling-elem('indicator') { + &::after { + border-color: fn.color(--hover --handle-border); + } + } + } + + &:checked { + @include iro.bem-sibling-elem('indicator') { + background-color: fn.color(--handle-border); + + &::after { + transform: translate(calc(fn.dim(--width) - fn.dim(--height) + .5px), 0); + border-color: fn.color(--handle-border); + } + } + + &:hover { + @include iro.bem-sibling-elem('indicator') { + background-color: fn.color(--hover --handle-border); + + &::after { + border-color: fn.color(--hover --handle-border); + } + } + } + } + + &:disabled { + @include iro.bem-sibling-elem('label') { + color: fn.color(--disabled --label); + } + + @include iro.bem-sibling-elem('indicator') { + background-color: fn.color(--disabled --track-bg); + + &::after { + border-color: fn.color(--disabled --handle-border); + background-color: fn.color(--disabled --handle-bg); + } + } + + &:checked { + @include iro.bem-sibling-elem('indicator') { + background-color: fn.color(--disabled --handle-border); + + &::after { + border-color: fn.color(--disabled --handle-border); + } + } + } + } + + @include iro.bem-at-theme('keyboard') { + &:focus { + @include iro.bem-sibling-elem('label') { + color: fn.color(--key-focus --label); + } + + @include iro.bem-sibling-elem('indicator') { + &::after { + border-color: fn.color(--key-focus --handle-border); + box-shadow: fn.color(--key-focus --shadow); + } + } + + &:checked { + @include iro.bem-sibling-elem('indicator') { + background-color: fn.color(--key-focus --track-bg); + } + } + } + } + } + + @include iro.bem-modifier('standalone') { + @include iro.bem-elem('indicator') { + margin-top: 0; + } + } + + @include iro.bem-modifier('accent') { + @include iro.bem-elem('native') { + &:checked { + @include iro.bem-sibling-elem('indicator') { + background-color: fn.color(--accent --handle-border); + + &::after { + border-color: fn.color(--accent --handle-border); + } + } + + &:hover { + @include iro.bem-sibling-elem('indicator') { + background-color: fn.color(--accent --hover --handle-border); + + &::after { + border-color: fn.color(--accent --hover --handle-border); + } + } + } + } + + &:disabled { + @include iro.bem-sibling-elem('label') { + color: fn.color(--disabled --label); + } + + &:checked { + @include iro.bem-sibling-elem('indicator') { + background-color: fn.color(--disabled --handle-border); + + &::after { + border-color: fn.color(--disabled --handle-border); + } + } + } + } + } + } + } +} diff --git a/src/.old/objects/_table.scss b/src/.old/objects/_table.scss new file mode 100644 index 0000000..34512cb --- /dev/null +++ b/src/.old/objects/_table.scss @@ -0,0 +1,167 @@ +@use 'iro-sass/src/index' as iro; +@use '../functions' as fn; +@use '../mixins' as mx; + +@include iro.props-namespace('table') { + @include iro.props-store(( + --dims: ( + --pad-x: fn.global-dim(--size --175), + --pad-y: fn.global-dim(--size --125), + --rounding: 3px, + --50: ( + --pad-y: fn.global-dim(--size --75), + ) + ), + ), 'dims'); + + @include iro.props-store(( + --colors: ( + --border: fn.global-color(--obj), + --heading: fn.global-color(--fg-hi), + --hover: fn.global-color(--obj-hi), + --press: fn.global-color(--obj), + --box: ( + --bg: fn.global-color(--bg-hi2), + --hover: fn.global-color(--bg), + --press: fn.global-color(--obj-hi), + ) + ) + ), 'colors'); + + @include iro.bem-object(iro.props-namespace()) { + border-spacing: 0; + border-collapse: separate; + + @include iro.bem-modifier('fixed') { + table-layout: fixed; + } + + @include iro.bem-elem('head-cell') { + @include mx.set-font(--standard, ( + --line-height: null, + --size: fn.global-dim(--font-size --50), + --weight: 500, + --transform: uppercase, + --spacing: .5px + )); + + padding: fn.dim(--pad-y) fn.dim(--pad-x); + color: fn.color(--heading); + text-align: left; + } + + @include iro.bem-elem('cell') { + padding: fn.dim(--pad-y) fn.dim(--pad-x); + border-width: 1px 0 0; + border-style: solid; + border-color: fn.color(--border); + + @include iro.bem-modifier('divider') { + border-right-width: 1px; + } + } + + @include iro.bem-elem('row') { + &:last-child { + @include iro.bem-elem('cell') { + border-bottom-width: 1px; + } + } + } + + @include iro.bem-modifier('flush') { + @include iro.bem-elem('head-cell', 'cell') { + &:first-child { + padding-left: 0; + } + + &:last-child { + padding-right: 0; + } + } + } + + @include iro.bem-modifier('box') { + @include iro.bem-elem('cell') { + background-color: fn.color(--box --bg); + + &:first-child { + border-left-width: 1px; + } + + &:last-child { + border-right-width: 1px; + } + } + + @include iro.bem-elem('row') { + &:first-child { + @include iro.bem-elem('cell') { + &:first-child { + border-top-left-radius: fn.dim(--rounding); + } + + &:last-child { + border-top-right-radius: fn.dim(--rounding); + } + } + } + + &:last-child { + @include iro.bem-elem('cell') { + &:first-child { + border-bottom-left-radius: fn.dim(--rounding); + } + + &:last-child { + border-bottom-right-radius: fn.dim(--rounding); + } + } + } + } + } + + @include iro.bem-modifier('interactive') { + @include iro.bem-elem('row') { + @include iro.bem-elem('cell') { + cursor: pointer; + } + + &:hover { + @include iro.bem-elem('cell') { + background-color: fn.color(--hover); + } + } + + &:active { + @include iro.bem-elem('cell') { + background-color: fn.color(--press); + } + } + } + + @include iro.bem-modifier('box') { + @include iro.bem-elem('row') { + &:hover { + @include iro.bem-elem('cell') { + background-color: fn.color(--box --hover); + } + } + + &:active { + @include iro.bem-elem('cell') { + background-color: fn.color(--box --press); + } + } + } + } + } + + @include iro.bem-modifier('50') { + @include iro.bem-elem('head-cell', 'cell') { + padding-top: fn.dim(--50 --pad-y); + padding-bottom: fn.dim(--50 --pad-y); + } + } + } +} diff --git a/src/.old/objects/_text-field.scss b/src/.old/objects/_text-field.scss new file mode 100644 index 0000000..88c4535 --- /dev/null +++ b/src/.old/objects/_text-field.scss @@ -0,0 +1,232 @@ +@use 'iro-sass/src/index' as iro; +@use '../functions' as fn; + +@mixin invalid { + @include iro.bem-sibling-elem('bg') { + border-color: fn.color(--error --border); + box-shadow: fn.color(--error --shadow); + } + + &:hover { + @include iro.bem-sibling-elem('bg') { + border-color: fn.color(--error --hover --border); + box-shadow: fn.color(--error --hover --shadow); + } + } + + &:focus { + @include iro.bem-sibling-elem('bg') { + border-color: fn.color(--error --focus --border); + box-shadow: fn.color(--error --focus --shadow); + } + } +} + +@mixin keyboard-focus { + @include iro.bem-sibling-elem('bg') { + border-color: fn.color(--key-focus --border); + box-shadow: fn.color(--key-focus --shadow); + } +} + +@include iro.props-namespace('text-field') { + @include iro.props-store(( + --dims: ( + --pad-x: fn.global-dim(--size --125), + --pad-y: fn.global-dim(--size --125), + --border: fn.global-dim(--border --thin), + --rounding: 2px, + + --extended: ( + --pad: fn.global-dim(--size --50), + --rounding: 6px, + ), + + --focus: ( + --border: fn.global-dim(--border --medium), + ) + ), + ), 'dims'); + + @include iro.props-store(( + --colors: ( + --bg: fn.global-color(--bg-hi2), + --placeholder: fn.global-color(--fg-hi2), + --text: fn.global-color(--fg), + --border: fn.global-color(--obj-lo), + --shadow: 0 0 0 0 transparent, + + --hover: ( + --border: fn.global-color(--fg-hi2), + --shadow: 0 0 0 0 transparent, + ), + --focus: ( + --border: fn.global-color(--accent --primary --solid --bg), + --shadow: 0 0 0 0 transparent, + ), + --key-focus: ( + --border: fn.global-color(--focus --fill), + --shadow: fn.global-color(--focus --shadow), + ), + --error: ( + --border: fn.global-color(--accent --error --solid --bg-hi), + --shadow: 0 0 0 0 transparent, + + --hover: ( + --border: fn.global-color(--accent --error --solid --bg), + --shadow: 0 0 0 0 transparent, + ), + --focus: ( + --border: fn.global-color(--accent --error --solid --bg), + --shadow: 0 0 0 0 transparent, + ), + ), + --disabled: ( + --bg: fn.global-color(--obj-hi), + --placeholder: fn.global-color(--fg-hi3), + --text: fn.global-color(--fg-hi3), + --border: fn.global-color(--obj-hi), + --shadow: 0 0 0 0 transparent, + ), + ), + ), 'colors'); + + @include iro.bem-object(iro.props-namespace()) { + $line-height: 1.4; + $focus-border-offset: calc(fn.dim(--border) - fn.dim(--focus --border)); + + position: relative; + min-width: 0; + border-radius: fn.dim(--rounding); + background-color: fn.color(--bg); + + @include iro.bem-elem('bg') { + display: block; + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + border: fn.dim(--border) solid fn.color(--border); + border-radius: fn.dim(--rounding); + box-shadow: fn.color(--shadow); + pointer-events: none; + } + + @include iro.bem-elem('native') { + box-sizing: border-box; + width: 100%; + padding: calc(fn.dim(--pad-y) - .5em * ($line-height - 1)) fn.dim(--pad-x); + border: 1px solid transparent; + background-color: transparent; + color: fn.color(--text); + font: inherit; + line-height: $line-height; + resize: none; + appearance: none; + + &::placeholder { + opacity: 1; + color: fn.color(--placeholder); + font-style: italic; + } + + &:hover { + @include iro.bem-sibling-elem('bg') { + border-color: fn.color(--hover --border); + box-shadow: fn.color(--hover --shadow); + } + } + + &:focus { + outline: 0; + + @include iro.bem-sibling-elem('bg') { + top: $focus-border-offset; + right: $focus-border-offset; + bottom: $focus-border-offset; + left: $focus-border-offset; + border: fn.dim(--focus --border) solid fn.color(--focus --border); + border-radius: calc(fn.dim(--rounding) - $focus-border-offset); + box-shadow: fn.color(--focus --shadow); + } + } + + &:invalid { + @include invalid; + } + } + + @include iro.bem-modifier('extended') { + padding: fn.dim(--extended --pad); + + @include iro.bem-multi('&', 'elem' 'bg') { + border-radius: calc(fn.dim(--rounding) + fn.dim(--extended --pad)); + } + + @include iro.bem-elem('native') { + &:focus { + @include iro.bem-sibling-elem('bg') { + border-radius: calc(fn.dim(--extended --rounding) - $focus-border-offset); + } + } + } + } + + @include iro.bem-is('invalid') { + @include iro.bem-elem('native') { + @include invalid; + } + } + + @include iro.bem-at-theme('keyboard') { + @include iro.bem-elem('native') { + &:focus, + &:invalid:focus { + @include keyboard-focus; + } + } + + @include iro.bem-is('invalid') { + @include iro.bem-elem('native') { + &:focus { + @include keyboard-focus; + } + } + } + } + + @include iro.bem-is('disabled') { + background-color: fn.color(--disabled --bg); + box-shadow: fn.color(--disabled --shadow); + + @include iro.bem-elem('native') { + color: fn.color(--disabled --text); + + &::placeholder { + color: fn.color(--disabled --placeholder); + } + } + + @include iro.bem-elem('bg') { + border-color: fn.color(--disabled --border); + } + + @include iro.bem-is('invalid') { + @include iro.bem-elem('native') { + @include iro.bem-sibling-elem('bg') { + border-color: fn.color(--disabled --border); + } + } + } + + @include iro.bem-elem('native') { + &:invalid { + @include iro.bem-sibling-elem('bg') { + border-color: fn.color(--disabled --border); + } + } + } + } + } +} -- cgit v1.2.3-54-g00ecf