@use 'sass:map'; @use '../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; $key-focus--label-color: props.def(--o-avatar--key-focus--label-color, props.get(core.$theme, --focus, --text)) !default; $key-focus--border-color: props.def(--o-avatar--key-focus--border-color, props.get(core.$theme, --focus, --border)) !default; $key-focus--outline-color: props.def(--o-avatar--key-focus--outline-color, props.get(core.$theme, --focus, --outline)) !default; $default-theme-override: () !default; $default-theme: props.def(--o-badge, ( --bg: props.def(--o-badge--bg-color, props.get(core.$theme, --text-mute)), --label: props.def(--o-badge--label-color, props.get(core.$theme, --bg-l2)), --hover: ( --bg: props.def(--o-badge--hover--bg-color, props.get(core.$theme, --text)), --label: props.def(--o-badge--label-color, props.get(core.$theme, --bg-l2)), ), --active: ( --bg: props.def(--o-badge--active--bg-color, props.get(core.$theme, --heading)), --label: props.def(--o-badge--label-color, props.get(core.$theme, --bg-l2)), ), --quiet: ( --bg: props.def(--o-badge--quiet--bg-color, props.get(core.$theme, --border-mute)), --label: props.def(--o-badge--quiet--label-color, props.get(core.$theme, --heading)), --hover: ( --bg: props.def(--o-badge--quiet--hover--bg-color, props.get(core.$theme, --border)), --label: props.def(--o-badge--quiet--label-color, props.get(core.$theme, --heading)), ), --active: ( --bg: props.def(--o-badge--quiet--active--bg-color, props.get(core.$theme, --border-strong)), --label: props.def(--o-badge--quiet--label-color, props.get(core.$theme, --heading)), ), ) )); $default-theme: props.merge(--o-badge, $default-theme-override); $static-themes: props.def(--o-badge); @each $theme in map.keys(props.get(core.$transparent-colors)) { $badge-theme: #{$theme}-static; $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); @each $theme, $key in $themes-config { $themes: props.merge($themes, ( $key: ( --bg: props.get(core.$static-colors, $key, --900), --label: props.get(core.$static-colors, $key, --900-text), --hover: ( --bg: props.get(core.$static-colors, $key, --1000), --label: props.get(core.$static-colors, $key, --1000-text), ), --active: ( --bg: props.get(core.$static-colors, $key, --1100), --label: props.get(core.$static-colors, $key, --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), ), ) ) )); }