@use 'sass:map'; @use 'sass:string'; @use 'iro-sass/src/props'; @use '../core.vars' as core; $pad-b: props.def(--o-badge--pad-b, props.get(core.$size--50)) !default; $pad-i: props.def(--o-badge--pad-i, props.get(core.$size--100)) !default; $pad-i-pill: props.def(--o-badge--pad-i-pill, props.get(core.$size--150)) !default; $pad-i-label: props.def(--o-badge--pad-i-label, props.get(core.$size--50)) !default; $rounding: props.def(--o-badge--rounding, props.get(core.$rounding)) !default; $font-size: props.def(--o-badge--font-size, props.get(core.$font-size--75)) !default; $pad-b--sm: props.def(--o-badge--sm--pad-b, props.get(core.$size--25)) !default; $pad-i--sm: props.def(--o-badge--sm--pad-i, props.get(core.$size--75)) !default; $pad-i-pill--sm: props.def(--o-badge--sm--pad-i-pill, props.get(core.$size--125)) !default; $pad-i-label--sm: props.def(--o-badge--sm--pad-i-label, props.get(core.$size--25)) !default; $font-size--sm: props.def(--o-badge--sm--font-size, props.get(core.$font-size--50)) !default; $pad-b--lg: props.def(--o-badge--lg--pad-b, props.get(core.$size--75)) !default; $pad-i--lg: props.def(--o-badge--lg--pad-i, props.get(core.$size--125)) !default; $pad-i-pill--lg: props.def(--o-badge--lg--pad-i-pill, props.get(core.$size--175)) !default; $pad-i-label--lg: props.def(--o-badge--lg--pad-i-label, props.get(core.$size--50)) !default; $font-size--lg: props.def(--o-badge--lg--font-size, props.get(core.$font-size--100)) !default; $pad-b--xl: props.def(--o-badge--xl--pad-b, props.get(core.$size--100)) !default; $pad-i--xl: props.def(--o-badge--xl--pad-i, props.get(core.$size--150)) !default; $pad-i-pill--xl: props.def(--o-badge--xl--pad-i-pill, props.get(core.$size--225)) !default; $pad-i-label--xl: props.def(--o-badge--xl--pad-i-label, props.get(core.$size--75)) !default; $font-size--xl: props.def(--o-badge--xl--font-size, props.get(core.$font-size--150)) !default; $key-focus--border-width: props.def(--o-badge--key-focus--border-width, props.get(core.$key-focus--border-width)) !default; $key-focus--border-offset: props.def(--o-badge--key-focus--border-offset, props.get(core.$key-focus--border-offset)) !default; $key-focus--outline-width: props.def(--o-badge--key-focus--outline-width, props.get(core.$key-focus--outline-width)) !default; $sizes: ( 'sm' $pad-b--sm $pad-i--sm $pad-i-pill--sm $pad-i-label--sm $font-size--sm, 'lg' $pad-b--lg $pad-i--lg $pad-i-pill--lg $pad-i-label--lg $font-size--lg, 'xl' $pad-b--xl $pad-i--xl $pad-i-pill--xl $pad-i-label--xl $font-size--xl, ) !default; $default-theme-override: () !default; $default-theme: props.def(--o-badge, ( --bg: props.get(core.$theme, --text), --label: props.get(core.$theme, --bg-l2), --hover: ( --bg: props.get(core.$theme, --heading), --label: props.get(core.$theme, --bg-l2), ), --active: ( --bg: props.get(core.$theme, --heading), --label: props.get(core.$theme, --bg-l2), ), --key-focus: ( --label: props.get(core.$theme, --focus, --text), --border: props.get(core.$theme, --focus, --border), --outline: props.get(core.$theme, --focus, --outline), ), --quiet: ( --bg: props.get(core.$theme, --border-mute), --label: props.get(core.$theme, --heading), --hover: ( --bg: props.get(core.$theme, --border), --label: props.get(core.$theme, --heading), ), --active: ( --bg: props.get(core.$theme, --border-strong), --label: props.get(core.$theme, --heading), ), ) ), 'color'); $default-theme: props.merge($default-theme, $default-theme-override); $static-themes: props.def(--o-badge, (), 'color'); @each $theme in map.keys(props.get(core.$transparent-colors)) { $badge-theme: --static-#{string.slice($theme, 3)}; $static-themes: props.merge($static-themes, ( $badge-theme: ( --bg: props.get(core.$transparent-colors, $theme, --800), --label: props.get(core.$transparent-colors, $theme, --text), --hover: ( --bg: props.get(core.$transparent-colors, $theme, --900), --label: props.get(core.$transparent-colors, $theme, --text), ), --active: ( --bg: props.get(core.$transparent-colors, $theme, --900), --label: props.get(core.$transparent-colors, $theme, --text), ), --key-focus: ( --bg: props.get(core.$transparent-colors, $theme, --100), --label: props.get(core.$transparent-colors, $theme, --900), --border: props.get(core.$transparent-colors, $theme, --900), --outline: props.get(core.$transparent-colors, $theme, --300), ), --quiet: ( --bg: props.get(core.$transparent-colors, $theme, --200), --label: props.get(core.$transparent-colors, $theme, --900), --hover: ( --bg: props.get(core.$transparent-colors, $theme, --300), --label: props.get(core.$transparent-colors, $theme, --900), ), --active: ( --bg: props.get(core.$transparent-colors, $theme, --400), --label: props.get(core.$transparent-colors, $theme, --900), ), ) ) )); } $themes-config: ( accent: --accent, positive: --positive, negative: --negative, warning: --warning, ) !default; $themes: props.def(--o-badge, (), 'color'); @each $theme, $key in $themes-config { $themes: props.merge($themes, ( --#{$theme}: ( --bg: props.get(core.$theme, #{$key}-static, --900), --label: props.get(core.$theme, #{$key}-static, --900-text), --hover: ( --bg: props.get(core.$theme, #{$key}-static, --1000), --label: props.get(core.$theme, #{$key}-static, --1000-text), ), --active: ( --bg: props.get(core.$theme, #{$key}-static, --1100), --label: props.get(core.$theme, #{$key}-static, --1000-text), ), --quiet: ( --bg: props.get(core.$theme, $key, --200), --label: props.get(core.$theme, $key, --1100), --hover: ( --bg: props.get(core.$theme, $key, --300), --label: props.get(core.$theme, $key, --1200), ), --active: ( --bg: props.get(core.$theme, $key, --400), --label: props.get(core.$theme, $key, --1300), ), ) ) )); }