From 50f6acc739f24bfa2ca080d08e90d82f8fa83543 Mon Sep 17 00:00:00 2001 From: Volpeon Date: Thu, 17 Oct 2024 16:45:00 +0200 Subject: Revamped variable management --- src/objects/_radio.scss | 185 ------------------------------------------------ 1 file changed, 185 deletions(-) delete mode 100644 src/objects/_radio.scss (limited to 'src/objects/_radio.scss') diff --git a/src/objects/_radio.scss b/src/objects/_radio.scss deleted file mode 100644 index 9fa937d..0000000 --- a/src/objects/_radio.scss +++ /dev/null @@ -1,185 +0,0 @@ -@use 'iro-sass/src/index' as iro; -@use '../functions' as fn; - -@include iro.props-namespace('radio') { - @include iro.props-store(( - --dims: ( - --diameter: fn.global-dim(--size --200), - --label-gap: fn.global-dim(--size --125), - --border: fn.global-dim(--border --medium), - --pad-i: fn.global-dim(--size --65), - --pad-b: fn.global-dim(--size --65), - --rounding: fn.global-dim(--rounding), - --spacing-sibling: fn.global-dim(--size --300), - - --key-focus: ( - --border: fn.global-dim(--key-focus --border), - --border-offset: fn.global-dim(--key-focus --border-offset), - --outline: fn.global-dim(--key-focus --outline), - ), - ), - --colors: ( - --circle-border: fn.global-color(--text-mute-more), - --circle-bg: fn.global-color(--base --75), - - --hover: ( - --label: fn.global-color(--heading), - --circle-border: fn.global-color(--text-mute), - ), - --accent: ( - --circle-border: fn.global-color(--accent --900), - - --hover: ( - --circle-border: fn.global-color(--accent --1000), - ), - ), - --disabled: ( - --label: fn.global-color(--text-disabled), - --circle-border: fn.global-color(--border-strong), - --circle-bg: fn.global-color(--base --75), - ), - --key-focus: ( - --label: fn.global-color(--focus --text), - --border: fn.global-color(--focus --border), - --outline: fn.global-color(--focus --outline), - ), - ), - )); - - @include iro.bem-object(iro.props-namespace()) { - display: inline-block; - position: relative; - margin-inline: - calc(-1 * fn.dim(--pad-i) - fn.dim(--key-focus --border-offset)) - calc(fn.dim(--spacing-sibling) - fn.dim(--pad-i) - fn.dim(--key-focus --border-offset)); - padding-block: fn.dim(--pad-b); - padding-inline: fn.dim(--pad-i); - - @include iro.bem-elem('circle') { - display: inline-block; - flex: 0 0 auto; - inline-size: fn.dim(--diameter); - block-size: fn.dim(--diameter); - margin-block-start: calc(.5em * fn.global-dim(--font --standard --line-height) - .5 * fn.dim(--diameter) - fn.dim(--key-focus --border-offset)); - border: fn.dim(--key-focus --border-offset) solid transparent; - border-radius: 2em; - background-color: fn.color(--circle-border); - background-clip: padding-box; - vertical-align: top; - - &::after { - content: ''; - display: block; - position: relative; - inset-block-start: fn.dim(--border); - inset-inline-start: fn.dim(--border); - inline-size: calc(fn.dim(--diameter) - 2 * fn.dim(--border)); - block-size: 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') { - margin-inline-start: calc(fn.dim(--label-gap) - fn.dim(--key-focus --border-offset)); - } - - @include iro.bem-elem('native') { - appearance: none; - position: absolute; - z-index: -1; - inset-block-start: 0; - inset-inline-start: 0; - inline-size: 100%; - block-size: 100%; - margin: 0; - padding: 0; - overflow: hidden; - border-radius: fn.dim(--rounding); - - &:hover, - &:focus-visible { - @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); - } - } - } - - &:focus-visible { - @include iro.bem-sibling-elem('label') { - color: fn.color(--key-focus --label); - } - - @include iro.bem-sibling-elem('circle') { - outline: fn.color(--key-focus --border) solid fn.dim(--key-focus --border); - box-shadow: 0 0 0 calc(fn.dim(--key-focus --border) + fn.dim(--key-focus --outline)) fn.color(--key-focus --outline); - } - } - } - - @include iro.bem-modifier('standalone') { - @include iro.bem-elem('circle') { - margin-block-start: 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, - &:focus-visible { - @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