From 64a841c69ead262666dd0754218585d0f05cf735 Mon Sep 17 00:00:00 2001 From: Volpeon Date: Sun, 23 Jun 2024 19:05:33 +0200 Subject: WIP: New color calculations --- src/.old/objects/_checkbox.scss | 249 ---------------------------------------- src/.old/objects/_radio.scss | 176 ---------------------------- 2 files changed, 425 deletions(-) delete mode 100644 src/.old/objects/_checkbox.scss delete mode 100644 src/.old/objects/_radio.scss (limited to 'src/.old/objects') diff --git a/src/.old/objects/_checkbox.scss b/src/.old/objects/_checkbox.scss deleted file mode 100644 index b3bb34d..0000000 --- a/src/.old/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/.old/objects/_radio.scss b/src/.old/objects/_radio.scss deleted file mode 100644 index 5af7a12..0000000 --- a/src/.old/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); - } - } - } - } - } - } -} -- cgit v1.2.3-70-g09d2