From 48cb00040763459fc46d4aa108bf72c12f48f422 Mon Sep 17 00:00:00 2001 From: Volpeon Date: Fri, 21 Jun 2024 23:07:50 +0200 Subject: WIP: Refactoring --- src/objects/_action-button.scss | 222 --------------------------------- src/objects/_action-menu.scss | 122 ------------------ src/objects/_alert.scss | 55 -------- src/objects/_avatar.scss | 146 ---------------------- src/objects/_backdrop.scss | 33 ----- src/objects/_badge.scss | 173 -------------------------- src/objects/_button.scss | 179 -------------------------- src/objects/_checkbox.scss | 249 ------------------------------------- src/objects/_dialog.scss | 152 ---------------------- src/objects/_divider.scss | 51 ++++---- src/objects/_emoji.scss | 74 ----------- src/objects/_field-label.scss | 89 ------------- src/objects/_heading.scss | 29 ++--- src/objects/_icon-nav.scss | 20 --- src/objects/_icon.scss | 26 ---- src/objects/_lightbox.scss | 206 ------------------------------ src/objects/_list-group.scss | 60 --------- src/objects/_menu.scss | 124 ------------------ src/objects/_message.scss | 51 -------- src/objects/_overflow-button.scss | 243 ------------------------------------ src/objects/_palette.scss | 38 ++++++ src/objects/_radio.scss | 176 -------------------------- src/objects/_status-indicator.scss | 35 ------ src/objects/_switch.scss | 221 -------------------------------- src/objects/_table.scss | 167 ------------------------- src/objects/_text-field.scss | 232 ---------------------------------- 26 files changed, 74 insertions(+), 3099 deletions(-) delete mode 100644 src/objects/_action-button.scss delete mode 100644 src/objects/_action-menu.scss delete mode 100644 src/objects/_alert.scss delete mode 100644 src/objects/_avatar.scss delete mode 100644 src/objects/_backdrop.scss delete mode 100644 src/objects/_badge.scss delete mode 100644 src/objects/_button.scss delete mode 100644 src/objects/_checkbox.scss delete mode 100644 src/objects/_dialog.scss delete mode 100644 src/objects/_emoji.scss delete mode 100644 src/objects/_field-label.scss delete mode 100644 src/objects/_icon-nav.scss delete mode 100644 src/objects/_icon.scss delete mode 100644 src/objects/_lightbox.scss delete mode 100644 src/objects/_list-group.scss delete mode 100644 src/objects/_menu.scss delete mode 100644 src/objects/_message.scss delete mode 100644 src/objects/_overflow-button.scss create mode 100644 src/objects/_palette.scss delete mode 100644 src/objects/_radio.scss delete mode 100644 src/objects/_status-indicator.scss delete mode 100644 src/objects/_switch.scss delete mode 100644 src/objects/_table.scss delete mode 100644 src/objects/_text-field.scss (limited to 'src/objects') diff --git a/src/objects/_action-button.scss b/src/objects/_action-button.scss deleted file mode 100644 index 48ac2a6..0000000 --- a/src/objects/_action-button.scss +++ /dev/null @@ -1,222 +0,0 @@ -@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/objects/_action-menu.scss b/src/objects/_action-menu.scss deleted file mode 100644 index 12e3b5f..0000000 --- a/src/objects/_action-menu.scss +++ /dev/null @@ -1,122 +0,0 @@ -@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/objects/_alert.scss b/src/objects/_alert.scss deleted file mode 100644 index 289ef10..0000000 --- a/src/objects/_alert.scss +++ /dev/null @@ -1,55 +0,0 @@ -@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/objects/_avatar.scss b/src/objects/_avatar.scss deleted file mode 100644 index 4be780e..0000000 --- a/src/objects/_avatar.scss +++ /dev/null @@ -1,146 +0,0 @@ -@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/objects/_backdrop.scss b/src/objects/_backdrop.scss deleted file mode 100644 index ac23d63..0000000 --- a/src/objects/_backdrop.scss +++ /dev/null @@ -1,33 +0,0 @@ -@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/objects/_badge.scss b/src/objects/_badge.scss deleted file mode 100644 index 0f73382..0000000 --- a/src/objects/_badge.scss +++ /dev/null @@ -1,173 +0,0 @@ -@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/objects/_button.scss b/src/objects/_button.scss deleted file mode 100644 index 7cc24fa..0000000 --- a/src/objects/_button.scss +++ /dev/null @@ -1,179 +0,0 @@ -@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/objects/_checkbox.scss b/src/objects/_checkbox.scss deleted file mode 100644 index b3bb34d..0000000 --- a/src/objects/_checkbox.scss +++ /dev/null @@ -1,249 +0,0 @@ -@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/objects/_dialog.scss b/src/objects/_dialog.scss deleted file mode 100644 index 9333ce6..0000000 --- a/src/objects/_dialog.scss +++ /dev/null @@ -1,152 +0,0 @@ -@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/objects/_divider.scss b/src/objects/_divider.scss index 655080f..465bbcf 100644 --- a/src/objects/_divider.scss +++ b/src/objects/_divider.scss @@ -4,7 +4,7 @@ @include iro.props-namespace('divider') { @include iro.props-store(( --dims: ( - --margin-y: fn.global-dim(--size --85), + --margin-b: fn.global-dim(--size --85), --strong: ( --border: fn.global-dim(--border --thick), @@ -19,52 +19,48 @@ --label-font-size: fn.global-dim(--font-size --50), ), ), - ), 'dims'); - - @include iro.props-store(( --colors: ( --strong: ( - --bg: fn.global-color(--fg), - --label: fn.global-color(--fg), + --bg: fn.global-color(--text), + --label: fn.global-color(--text), ), --medium: ( - --bg: fn.global-color(--obj), - --label: fn.global-color(--fg-hi), + --bg: fn.global-color(--border), + --label: fn.global-color(--text-mute), ), --faint: ( - --bg: fn.global-color(--obj), - --label: fn.global-color(--fg-hi2), + --bg: fn.global-color(--border), + --label: fn.global-color(--text-mute-more), ), --blue: ( - --bg: fn.global-color(--blue --solid --bg), - --label: fn.global-color(--blue --solid --obj), + --bg: fn.global-color(--blue --700), + --label: fn.global-color(--blue --1000), ), --purple: ( - --bg: fn.global-color(--purple --solid --bg), - --label: fn.global-color(--purple --solid --obj), + --bg: fn.global-color(--purple --700), + --label: fn.global-color(--purple --1000), ), --red: ( - --bg: fn.global-color(--red --solid --bg), - --label: fn.global-color(--red --solid --obj), + --bg: fn.global-color(--red --700), + --label: fn.global-color(--red --1000), ), --green: ( - --bg: fn.global-color(--green --solid --bg), - --label: fn.global-color(--green --solid --obj), + --bg: fn.global-color(--green --700), + --label: fn.global-color(--green --1000), ), --yellow: ( - --bg: fn.global-color(--yellow --solid --bg), - --label: fn.global-color(--yellow --solid --obj), + --bg: fn.global-color(--yellow --700), + --label: fn.global-color(--yellow --1000), ), ), - ), 'colors'); + )); @include iro.bem-object(iro.props-namespace()) { display: flex; flex-direction: row; align-items: center; height: 1em; - margin-top: fn.dim(--margin-y); - margin-bottom: fn.dim(--margin-y); + margin-block: fn.dim(--margin-b); color: fn.color(--strong --label); font-size: fn.dim(--strong --label-font-size); font-weight: 700; @@ -93,8 +89,7 @@ align-self: stretch; width: 1px; height: auto; - margin-top: 0; - margin-bottom: 0; + margin-block: 0; background-color: fn.color(--faint --bg); &::before, @@ -129,12 +124,12 @@ @include iro.bem-modifier('labelled') { &::before { - margin-right: 1em; + margin-inline-end: 1em; } &::after { - display: block; - margin-left: 1em; + display: block; + margin-inline-start: 1em; } } diff --git a/src/objects/_emoji.scss b/src/objects/_emoji.scss deleted file mode 100644 index 8d17212..0000000 --- a/src/objects/_emoji.scss +++ /dev/null @@ -1,74 +0,0 @@ -@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/objects/_field-label.scss b/src/objects/_field-label.scss deleted file mode 100644 index 2127a09..0000000 --- a/src/objects/_field-label.scss +++ /dev/null @@ -1,89 +0,0 @@ -@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/objects/_heading.scss b/src/objects/_heading.scss index 5d84e61..6dcf7e9 100644 --- a/src/objects/_heading.scss +++ b/src/objects/_heading.scss @@ -8,37 +8,34 @@ @include iro.props-store(( --dims: ( --offset: -.02em, - ) - ), 'dims'); - - @include iro.props-store(( + ), --colors: ( - --light: fn.global-color(--fg-hi), - --strong: fn.global-color(--fg-lo), - --bg: fn.global-color(--bg-hi2), + --light: fn.global-color(--text-mute), + --strong: fn.global-color(--heading), + --bg: fn.global-color(--bg-l2), ), - ), 'colors'); + )); @include iro.bem-object(iro.props-namespace()) { @include mx.set-font(--headline); - display: block; - margin-top: fn.global-dim(--heading --margin-top); - transform: translateX(fn.dim(--offset)); - letter-spacing: normal; - text-transform: none; + display: block; + margin-block-start: fn.global-dim(--heading --margin-bs); + transform: translateX(fn.dim(--offset)); + letter-spacing: normal; + text-transform: none; & + & { - margin-top: fn.global-dim(--heading --margin-top-sibling); + margin-block-start: fn.global-dim(--heading --margin-bs-sibling); } @include iro.bem-elem('highlight') { background-image: linear-gradient( to top, - transparent .05em, + transparent .05em, fn.color(--bg) .05em, fn.color(--bg) .5em, - transparent .5em + transparent .5em ); } diff --git a/src/objects/_icon-nav.scss b/src/objects/_icon-nav.scss deleted file mode 100644 index d1c6539..0000000 --- a/src/objects/_icon-nav.scss +++ /dev/null @@ -1,20 +0,0 @@ -@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/objects/_icon.scss b/src/objects/_icon.scss deleted file mode 100644 index 5c4bfab..0000000 --- a/src/objects/_icon.scss +++ /dev/null @@ -1,26 +0,0 @@ -@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/objects/_lightbox.scss b/src/objects/_lightbox.scss deleted file mode 100644 index 31d3398..0000000 --- a/src/objects/_lightbox.scss +++ /dev/null @@ -1,206 +0,0 @@ -@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/objects/_list-group.scss b/src/objects/_list-group.scss deleted file mode 100644 index d46722e..0000000 --- a/src/objects/_list-group.scss +++ /dev/null @@ -1,60 +0,0 @@ -@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/objects/_menu.scss b/src/objects/_menu.scss deleted file mode 100644 index 7db4896..0000000 --- a/src/objects/_menu.scss +++ /dev/null @@ -1,124 +0,0 @@ -@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/objects/_message.scss b/src/objects/_message.scss deleted file mode 100644 index 283ce26..0000000 --- a/src/objects/_message.scss +++ /dev/null @@ -1,51 +0,0 @@ -@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/objects/_overflow-button.scss b/src/objects/_overflow-button.scss deleted file mode 100644 index b15ea1f..0000000 --- a/src/objects/_overflow-button.scss +++ /dev/null @@ -1,243 +0,0 @@ -@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/objects/_palette.scss b/src/objects/_palette.scss new file mode 100644 index 0000000..a86c026 --- /dev/null +++ b/src/objects/_palette.scss @@ -0,0 +1,38 @@ +@use 'sass:map'; +@use 'sass:list'; +@use 'iro-sass/src/index' as iro; +@use '../functions' as fn; +@use '../config'; + +@include iro.props-namespace('palette') { + @include iro.bem-object(iro.props-namespace()) { + display: flex; + height: 3em; + + @include iro.bem-elem('item') { + flex: 1 1 auto; + + @for $i from 1 through list.length(map.get(config.$theme-light, --grays)) { + $key: list.nth(map.keys(map.get(config.$theme-light, --grays)), $i); + + &:nth-child(#{$i}) { + background-color: fn.global-color(--base $key); + } + } + } + + @each $palette in 'blue' 'purple' 'red' 'green' 'yellow' { + @include iro.bem-modifier($palette) { + @include iro.bem-elem('item') { + @for $i from 1 through list.length(map.get(config.$theme-light, --colors)) { + $key: list.nth(map.keys(map.get(config.$theme-light, --colors)), $i); + + &:nth-child(#{$i}) { + background-color: fn.global-color(--#{$palette} $key); + } + } + } + } + } + } +} diff --git a/src/objects/_radio.scss b/src/objects/_radio.scss deleted file mode 100644 index 5af7a12..0000000 --- a/src/objects/_radio.scss +++ /dev/null @@ -1,176 +0,0 @@ -@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/objects/_status-indicator.scss b/src/objects/_status-indicator.scss deleted file mode 100644 index d8ea9ef..0000000 --- a/src/objects/_status-indicator.scss +++ /dev/null @@ -1,35 +0,0 @@ -@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/objects/_switch.scss b/src/objects/_switch.scss deleted file mode 100644 index cbbb9b7..0000000 --- a/src/objects/_switch.scss +++ /dev/null @@ -1,221 +0,0 @@ -@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/objects/_table.scss b/src/objects/_table.scss deleted file mode 100644 index 34512cb..0000000 --- a/src/objects/_table.scss +++ /dev/null @@ -1,167 +0,0 @@ -@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/objects/_text-field.scss b/src/objects/_text-field.scss deleted file mode 100644 index 88c4535..0000000 --- a/src/objects/_text-field.scss +++ /dev/null @@ -1,232 +0,0 @@ -@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