From e3d34a6d6ce2db04c3c898ad6a4687a0c59df996 Mon Sep 17 00:00:00 2001 From: Volpeon Date: Fri, 18 Oct 2024 19:07:42 +0200 Subject: Update --- src/_core.scss | 33 ++++++ src/_core.vars.scss | 203 +++++++++++++++++++++++++++++++++++ src/_iro-design.scss | 4 +- src/_vars.scss | 33 ------ src/_vars.vars.scss | 203 ----------------------------------- src/layouts/_button-group.vars.scss | 4 +- src/layouts/_card-list.vars.scss | 26 ++--- src/layouts/_container.vars.scss | 14 +-- src/layouts/_form.vars.scss | 6 +- src/layouts/_media.vars.scss | 10 +- src/layouts/_overflow.scss | 4 +- src/objects/_action-button.vars.scss | 188 ++++++++++++++++---------------- src/objects/_alert.scss | 50 +++------ src/objects/_alert.vars.scss | 26 +++++ src/objects/_avatar.scss | 131 +++++++--------------- src/objects/_avatar.vars.scss | 52 +++++++++ src/objects/_heading.scss | 8 +- src/scopes/_blockquotes.vars.scss | 14 +-- src/scopes/_code.vars.scss | 26 ++--- src/scopes/_headings.scss | 2 +- src/scopes/_implicit.scss | 22 ++-- src/scopes/_implicit.vars.scss | 8 +- src/scopes/_links.vars.scss | 48 ++++----- src/scopes/_lists.scss | 4 +- src/scopes/_lists.vars.scss | 10 +- src/scopes/_tables.vars.scss | 8 +- src_demo/index.scss | 4 +- 27 files changed, 579 insertions(+), 562 deletions(-) create mode 100644 src/_core.scss create mode 100644 src/_core.vars.scss delete mode 100644 src/_vars.scss delete mode 100644 src/_vars.vars.scss create mode 100644 src/objects/_avatar.vars.scss diff --git a/src/_core.scss b/src/_core.scss new file mode 100644 index 0000000..e1205c4 --- /dev/null +++ b/src/_core.scss @@ -0,0 +1,33 @@ +@use 'sass:map'; +@use 'sass:meta'; +@use 'iro-sass/src/props'; +@use 'themes'; + +@use 'core.vars' as vars; +@forward 'core.vars'; + +@mixin styles { + @each $theme-name, $theme in vars.$themes { + @if $theme-name == themes.$theme-default { + :root { + @include props.materialize(map.values(meta.module-variables('vars'))); + + @if map.has-key($theme, 'dark') { + @media (prefers-color-scheme: dark) { + @include props.materialize(map.get($theme, 'dark')); + } + } + } + } @else { + @include iro.bem-theme($theme-name) { + @include props.materialize(map.get($theme, 'light')); + + @if map.has-key($theme, 'dark') { + @media (prefers-color-scheme: dark) { + @include props.materialize(map.get($theme, 'dark')); + } + } + } + } + } +} diff --git a/src/_core.vars.scss b/src/_core.vars.scss new file mode 100644 index 0000000..cc11b89 --- /dev/null +++ b/src/_core.vars.scss @@ -0,0 +1,203 @@ +@use 'sass:map'; +@use 'sass:meta'; +@use 'sass:list'; +@use 'iro-sass/src/iro-sass' as iro; +@use 'functions' as fn; +@use 'themes'; +@use 'props'; + +$size--0: props.def(--size--0, 0) !default; +$size--10: props.def(--size--10, iro.fn-px-to-rem(1px)) !default; +$size--25: props.def(--size--25, iro.fn-px-to-rem(2px)) !default; +$size--40: props.def(--size--40, iro.fn-px-to-rem(3px)) !default; +$size--50: props.def(--size--50, iro.fn-px-to-rem(4px)) !default; +$size--65: props.def(--size--65, iro.fn-px-to-rem(5px)) !default; +$size--75: props.def(--size--75, iro.fn-px-to-rem(6px)) !default; +$size--85: props.def(--size--85, iro.fn-px-to-rem(7px)) !default; +$size--100: props.def(--size--100, iro.fn-px-to-rem(8px)) !default; +$size--115: props.def(--size--115, iro.fn-px-to-rem(9px)) !default; +$size--125: props.def(--size--125, iro.fn-px-to-rem(10px)) !default; +$size--130: props.def(--size--130, iro.fn-px-to-rem(11px)) !default; +$size--150: props.def(--size--150, iro.fn-px-to-rem(12px)) !default; +$size--160: props.def(--size--160, iro.fn-px-to-rem(13px)) !default; +$size--175: props.def(--size--175, iro.fn-px-to-rem(14px)) !default; +$size--200: props.def(--size--200, iro.fn-px-to-rem(16px)) !default; +$size--225: props.def(--size--225, iro.fn-px-to-rem(18px)) !default; +$size--250: props.def(--size--250, iro.fn-px-to-rem(20px)) !default; +$size--275: props.def(--size--275, iro.fn-px-to-rem(22px)) !default; +$size--300: props.def(--size--300, iro.fn-px-to-rem(24px)) !default; +$size--325: props.def(--size--325, iro.fn-px-to-rem(26px)) !default; +$size--350: props.def(--size--350, iro.fn-px-to-rem(28px)) !default; +$size--375: props.def(--size--375, iro.fn-px-to-rem(30px)) !default; +$size--400: props.def(--size--400, iro.fn-px-to-rem(32px)) !default; +$size--450: props.def(--size--450, iro.fn-px-to-rem(36px)) !default; +$size--500: props.def(--size--500, iro.fn-px-to-rem(40px)) !default; +$size--550: props.def(--size--550, iro.fn-px-to-rem(44px)) !default; +$size--600: props.def(--size--600, iro.fn-px-to-rem(48px)) !default; +$size--650: props.def(--size--650, iro.fn-px-to-rem(52px)) !default; +$size--700: props.def(--size--700, iro.fn-px-to-rem(56px)) !default; +$size--800: props.def(--size--800, iro.fn-px-to-rem(64px)) !default; +$size--900: props.def(--size--900, iro.fn-px-to-rem(72px)) !default; +$size--1000: props.def(--size--1000, iro.fn-px-to-rem(80px)) !default; +$size--1200: props.def(--size--1200, iro.fn-px-to-rem(96px)) !default; +$size--1600: props.def(--size--1600, iro.fn-px-to-rem(128px)) !default; +$size--2000: props.def(--size--2000, iro.fn-px-to-rem(160px)) !default; +$size--2400: props.def(--size--2400, iro.fn-px-to-rem(192px)) !default; +$size--2500: props.def(--size--2500, iro.fn-px-to-rem(200px)) !default; +$size--2600: props.def(--size--2600, iro.fn-px-to-rem(208px)) !default; +$size--2800: props.def(--size--2800, iro.fn-px-to-rem(224px)) !default; +$size--3200: props.def(--size--3200, iro.fn-px-to-rem(256px)) !default; +$size--3400: props.def(--size--3400, iro.fn-px-to-rem(272px)) !default; +$size--3500: props.def(--size--3500, iro.fn-px-to-rem(280px)) !default; +$size--3600: props.def(--size--3600, iro.fn-px-to-rem(288px)) !default; +$size--3800: props.def(--size--3800, iro.fn-px-to-rem(304px)) !default; +$size--4600: props.def(--size--4600, iro.fn-px-to-rem(368px)) !default; +$size--5000: props.def(--size--5000, iro.fn-px-to-rem(400px)) !default; +$size--6000: props.def(--size--6000, iro.fn-px-to-rem(480px)) !default; + +$font--standard--family: props.def(--font--standard--family, ('Inter', 'Open Sans', 'Segoe UI', 'Droid Sans', Roboto, Oxygen, 'Helvetica Neue', Helvetica, Tahoma, Arial, sans-serif)) !default; +$font--standard--line-height: props.def(--font--standard--line-height, 1.5) !default; +$font--standard--feature-settings: props.def(--font--standard--feature-settings, ('\'ss01\'')) !default; + +$font--headline--family: props.def(--font--headline--family, ('Inter', props.get($font--standard--family))) !default; +$font--headline--line-height: props.def(--font--headline--line-height, 1.3) !default; +$font--headline--weight: props.def(--font--headline--weight, 800) !default; +$font--headline--feature-settings: props.def(--font--headline--feature-settings, ('\'opsz\'' 32, '\'ss01\'', '\'cv06\'')) !default; + +$font--mono--family: props.def(--font--mono--family, ('Iosevka Term SS09', 'IBM Plex Mono', 'Menlo', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', Courier, monospace)) !default; +$font--mono--line-height: props.def(--font--mono--line-height, 1.4) !default; + +$font-size--50: props.def(--font-size--50, iro.fn-px-to-rem(12px)) !default; +$font-size--75: props.def(--font-size--75 , iro.fn-px-to-rem(13px)) !default; +$font-size--100: props.def(--font-size--100, iro.fn-px-to-rem(14px)) !default; +$font-size--150: props.def(--font-size--150, iro.fn-px-to-rem(16px)) !default; +$font-size--200: props.def(--font-size--200, iro.fn-px-to-rem(18px)) !default; +$font-size--300: props.def(--font-size--300, iro.fn-px-to-rem(20px)) !default; +$font-size--400: props.def(--font-size--400, iro.fn-px-to-rem(24px)) !default; +$font-size--500: props.def(--font-size--500, iro.fn-px-to-rem(28px)) !default; +$font-size--600: props.def(--font-size--600, iro.fn-px-to-rem(32px)) !default; +$font-size--700: props.def(--font-size--700, iro.fn-px-to-rem(36px)) !default; +$font-size--800: props.def(--font-size--800, iro.fn-px-to-rem(40px)) !default; +$font-size--900: props.def(--font-size--900, iro.fn-px-to-rem(45px)) !default; +$font-size--1000: props.def(--font-size--1000, iro.fn-px-to-rem(50px)) !default; +$font-size--1100: props.def(--font-size--1100, iro.fn-px-to-rem(60px)) !default; + +$border-width--thick: props.def(--border-width--thick, 4px) !default; +$border-width--medium: props.def(--border-width--medium, 2px) !default; +$border-width--thin: props.def(--border-width--thin, 1px) !default; + +$shadow--x: props.def(--shadow--x, 0) !default; +$shadow--y: props.def(--shadow--y, 1px) !default; +$shadow--blur: props.def(--shadow--blur, 4px) !default; + +$rounding: props.def(--rounding, 4px) !default; + +$key-focus--outline-width: props.def(--key-focus--outline-width, props.get($border-width--thick)) !default; +$key-focus--border-width: props.def(--key-focus--border-width, props.get($border-width--medium)) !default; +$key-focus--border-offset: props.def(--key-focus--border-offset, props.get($border-width--medium)) !default; + +$heading--xxl: props.def(--heading--xxl, props.get($font-size--300)) !default; +$heading--xl: props.def(--heading--xl, props.get($font-size--200)) !default; +$heading--lg: props.def(--heading--lg, props.get($font-size--150)) !default; +$heading--md: props.def(--heading--md, props.get($font-size--100)) !default; +$heading--sm: props.def(--heading--sm, props.get($font-size--75)) !default; +$heading--xs: props.def(--heading--xs, props.get($font-size--50)) !default; +$heading--display--xxl: props.def(--heading--display--xxl, props.get($font-size--1100)) !default; +$heading--display--xl: props.def(--heading--display--xl, props.get($font-size--700)) !default; +$heading--display--lg: props.def(--heading--display--lg, props.get($font-size--300)) !default; +$heading--display--md: props.def(--heading--display--md, props.get($font-size--150)) !default; +$heading--display--sm: props.def(--heading--display--sm, props.get($font-size--75)) !default; +$heading--display--xs: props.def(--heading--display--xs, props.get($font-size--50)) !default; +$heading--display-sm--xxl: props.def(--heading--display-sm--xxl, props.get($font-size--900)) !default; +$heading--display-sm--xl: props.def(--heading--display-sm--xl, props.get($font-size--600)) !default; +$heading--display-sm--lg: props.def(--heading--display-sm--lg, props.get($font-size--200)) !default; +$heading--display-sm--md: props.def(--heading--display-sm--md, props.get($font-size--100)) !default; +$heading--display-sm--sm: props.def(--heading--display-sm--sm, props.get($font-size--75)) !default; +$heading--display-sm--xs: props.def(--heading--display-sm--xs, props.get($font-size--50)) !default; + +$list--indent: props.def(--list--indent, props.get($size--400)) !default; +$list--compact-indent: props.def(--list--indent, props.get($size--250)) !default; + +// + +$static-colors: props.def(--static-colors); + +@each $palette-name, $palette in map.get(themes.$static-colors, --palettes) { + $palette: fn.palette($palette, map.get(themes.$static-colors, --contrasts), 1, map.get(themes.$static-colors, --base)); + $static-colors: props.merge($static-colors, ( $palette-name: $palette )); +} + +// + +$transparent-colors: props.def(--transparent-colors); + +@each $palette-name, $palette in (--black: #000 #fff, --white: #fff #000) { + $color: list.nth($palette, 1); + $text: list.nth($palette, 2); + + $palette: fn.transparent-palette($color, $text, map.get(themes.$static-colors, --transparents)); + $transparent-colors: props.merge($transparent-colors, ( $palette-name: $palette )); +} + +// + +$themes: (); + +@each $theme-name, $theme in themes.$themes { + @each $variant-name, $variant in $theme { + $compiled: props.def(--colors); + + @each $palette-name, $palette in map.get($variant, --palettes) { + $base-color: list.nth($palette, 1); + $contrasts: list.nth($palette, 2); + $ranges: list.nth($palette, 3); + + $palette: fn.palette($base-color, map.get($variant, --contrasts, $contrasts), map.get($variant, --ranges, $ranges), list.nth(map.get($variant, --palettes, --base), 1)); + $compiled: props.merge($compiled, ( $palette-name: $palette )); + } + + @each $color, $value in map.get($variant, --constants) { + $compiled: props.merge($compiled, ( $color: $value )); + } + + @each $color, $ref in map.get($variant, --semantic) { + $res: (); + + @if meta.type-of($ref) == 'map' { + @each $key, $r in $ref { + $repo-name: list.nth($r, 1); + $re1: list.nth($r, 2); + $re2: iro.fn-list-slice($r, 3); + + $res2: null; + + @if $repo-name == --static { + $res2: props.get($static-colors, $re1, $re2...); + } @else { + $res2: props.get($compiled, $re1, $re2...); + } + + $res: map.merge($res, ($key: $res2)); + } + } @else { + $repo-name: list.nth($ref, 1); + $ref1: list.nth($ref, 2); + $ref2: iro.fn-list-slice($ref, 3); + + $res: null; + + @if $repo-name == --static { + $res: props.get($static-colors, $ref1, $ref2...); + } @else { + $res: props.get($compiled, $ref1, $ref2...); + } + } + + $compiled: props.merge($compiled, ( $color: $res )); + } + + $themes: map.set($themes, $theme-name, $variant-name, $compiled); + } +} + +$theme: map.get($themes, themes.$theme-default, light) !default; diff --git a/src/_iro-design.scss b/src/_iro-design.scss index f0f1e50..9aacc95 100644 --- a/src/_iro-design.scss +++ b/src/_iro-design.scss @@ -19,7 +19,7 @@ $breakpoints: ( $named-viewports: $breakpoints !default ); -@forward 'vars' as vars--*; +@forward 'core' as core--*; @forward 'layouts/button-group' as l-button-group--*; @forward 'layouts/card-list' as l-card-list--*; @@ -38,3 +38,5 @@ $breakpoints: ( //@use 'scopes/tables' as s-tables--*; @forward 'objects/action-button' as o-action-button--*; +@forward 'objects/alert' as o-alert--*; +@forward 'objects/avatar' as o-avatar--*; diff --git a/src/_vars.scss b/src/_vars.scss deleted file mode 100644 index 78ead7c..0000000 --- a/src/_vars.scss +++ /dev/null @@ -1,33 +0,0 @@ -@use 'sass:map'; -@use 'sass:meta'; -@use 'iro-sass/src/props'; -@use 'themes'; - -@use 'vars.vars' as vars; -@forward 'vars.vars'; - -@mixin vars { - @each $theme-name, $theme in vars.$themes { - @if $theme-name == themes.$theme-default { - :root { - @include props.materialize(map.get($theme, 'light')); - - @if map.has-key($theme, 'dark') { - @media (prefers-color-scheme: dark) { - @include props.materialize(map.get($theme, 'dark')); - } - } - } - } @else { - @include iro.bem-theme($theme-name) { - @include props.materialize(map.get($theme, 'light')); - - @if map.has-key($theme, 'dark') { - @media (prefers-color-scheme: dark) { - @include props.materialize(map.get($theme, 'dark')); - } - } - } - } - } -} diff --git a/src/_vars.vars.scss b/src/_vars.vars.scss deleted file mode 100644 index cc11b89..0000000 --- a/src/_vars.vars.scss +++ /dev/null @@ -1,203 +0,0 @@ -@use 'sass:map'; -@use 'sass:meta'; -@use 'sass:list'; -@use 'iro-sass/src/iro-sass' as iro; -@use 'functions' as fn; -@use 'themes'; -@use 'props'; - -$size--0: props.def(--size--0, 0) !default; -$size--10: props.def(--size--10, iro.fn-px-to-rem(1px)) !default; -$size--25: props.def(--size--25, iro.fn-px-to-rem(2px)) !default; -$size--40: props.def(--size--40, iro.fn-px-to-rem(3px)) !default; -$size--50: props.def(--size--50, iro.fn-px-to-rem(4px)) !default; -$size--65: props.def(--size--65, iro.fn-px-to-rem(5px)) !default; -$size--75: props.def(--size--75, iro.fn-px-to-rem(6px)) !default; -$size--85: props.def(--size--85, iro.fn-px-to-rem(7px)) !default; -$size--100: props.def(--size--100, iro.fn-px-to-rem(8px)) !default; -$size--115: props.def(--size--115, iro.fn-px-to-rem(9px)) !default; -$size--125: props.def(--size--125, iro.fn-px-to-rem(10px)) !default; -$size--130: props.def(--size--130, iro.fn-px-to-rem(11px)) !default; -$size--150: props.def(--size--150, iro.fn-px-to-rem(12px)) !default; -$size--160: props.def(--size--160, iro.fn-px-to-rem(13px)) !default; -$size--175: props.def(--size--175, iro.fn-px-to-rem(14px)) !default; -$size--200: props.def(--size--200, iro.fn-px-to-rem(16px)) !default; -$size--225: props.def(--size--225, iro.fn-px-to-rem(18px)) !default; -$size--250: props.def(--size--250, iro.fn-px-to-rem(20px)) !default; -$size--275: props.def(--size--275, iro.fn-px-to-rem(22px)) !default; -$size--300: props.def(--size--300, iro.fn-px-to-rem(24px)) !default; -$size--325: props.def(--size--325, iro.fn-px-to-rem(26px)) !default; -$size--350: props.def(--size--350, iro.fn-px-to-rem(28px)) !default; -$size--375: props.def(--size--375, iro.fn-px-to-rem(30px)) !default; -$size--400: props.def(--size--400, iro.fn-px-to-rem(32px)) !default; -$size--450: props.def(--size--450, iro.fn-px-to-rem(36px)) !default; -$size--500: props.def(--size--500, iro.fn-px-to-rem(40px)) !default; -$size--550: props.def(--size--550, iro.fn-px-to-rem(44px)) !default; -$size--600: props.def(--size--600, iro.fn-px-to-rem(48px)) !default; -$size--650: props.def(--size--650, iro.fn-px-to-rem(52px)) !default; -$size--700: props.def(--size--700, iro.fn-px-to-rem(56px)) !default; -$size--800: props.def(--size--800, iro.fn-px-to-rem(64px)) !default; -$size--900: props.def(--size--900, iro.fn-px-to-rem(72px)) !default; -$size--1000: props.def(--size--1000, iro.fn-px-to-rem(80px)) !default; -$size--1200: props.def(--size--1200, iro.fn-px-to-rem(96px)) !default; -$size--1600: props.def(--size--1600, iro.fn-px-to-rem(128px)) !default; -$size--2000: props.def(--size--2000, iro.fn-px-to-rem(160px)) !default; -$size--2400: props.def(--size--2400, iro.fn-px-to-rem(192px)) !default; -$size--2500: props.def(--size--2500, iro.fn-px-to-rem(200px)) !default; -$size--2600: props.def(--size--2600, iro.fn-px-to-rem(208px)) !default; -$size--2800: props.def(--size--2800, iro.fn-px-to-rem(224px)) !default; -$size--3200: props.def(--size--3200, iro.fn-px-to-rem(256px)) !default; -$size--3400: props.def(--size--3400, iro.fn-px-to-rem(272px)) !default; -$size--3500: props.def(--size--3500, iro.fn-px-to-rem(280px)) !default; -$size--3600: props.def(--size--3600, iro.fn-px-to-rem(288px)) !default; -$size--3800: props.def(--size--3800, iro.fn-px-to-rem(304px)) !default; -$size--4600: props.def(--size--4600, iro.fn-px-to-rem(368px)) !default; -$size--5000: props.def(--size--5000, iro.fn-px-to-rem(400px)) !default; -$size--6000: props.def(--size--6000, iro.fn-px-to-rem(480px)) !default; - -$font--standard--family: props.def(--font--standard--family, ('Inter', 'Open Sans', 'Segoe UI', 'Droid Sans', Roboto, Oxygen, 'Helvetica Neue', Helvetica, Tahoma, Arial, sans-serif)) !default; -$font--standard--line-height: props.def(--font--standard--line-height, 1.5) !default; -$font--standard--feature-settings: props.def(--font--standard--feature-settings, ('\'ss01\'')) !default; - -$font--headline--family: props.def(--font--headline--family, ('Inter', props.get($font--standard--family))) !default; -$font--headline--line-height: props.def(--font--headline--line-height, 1.3) !default; -$font--headline--weight: props.def(--font--headline--weight, 800) !default; -$font--headline--feature-settings: props.def(--font--headline--feature-settings, ('\'opsz\'' 32, '\'ss01\'', '\'cv06\'')) !default; - -$font--mono--family: props.def(--font--mono--family, ('Iosevka Term SS09', 'IBM Plex Mono', 'Menlo', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', Courier, monospace)) !default; -$font--mono--line-height: props.def(--font--mono--line-height, 1.4) !default; - -$font-size--50: props.def(--font-size--50, iro.fn-px-to-rem(12px)) !default; -$font-size--75: props.def(--font-size--75 , iro.fn-px-to-rem(13px)) !default; -$font-size--100: props.def(--font-size--100, iro.fn-px-to-rem(14px)) !default; -$font-size--150: props.def(--font-size--150, iro.fn-px-to-rem(16px)) !default; -$font-size--200: props.def(--font-size--200, iro.fn-px-to-rem(18px)) !default; -$font-size--300: props.def(--font-size--300, iro.fn-px-to-rem(20px)) !default; -$font-size--400: props.def(--font-size--400, iro.fn-px-to-rem(24px)) !default; -$font-size--500: props.def(--font-size--500, iro.fn-px-to-rem(28px)) !default; -$font-size--600: props.def(--font-size--600, iro.fn-px-to-rem(32px)) !default; -$font-size--700: props.def(--font-size--700, iro.fn-px-to-rem(36px)) !default; -$font-size--800: props.def(--font-size--800, iro.fn-px-to-rem(40px)) !default; -$font-size--900: props.def(--font-size--900, iro.fn-px-to-rem(45px)) !default; -$font-size--1000: props.def(--font-size--1000, iro.fn-px-to-rem(50px)) !default; -$font-size--1100: props.def(--font-size--1100, iro.fn-px-to-rem(60px)) !default; - -$border-width--thick: props.def(--border-width--thick, 4px) !default; -$border-width--medium: props.def(--border-width--medium, 2px) !default; -$border-width--thin: props.def(--border-width--thin, 1px) !default; - -$shadow--x: props.def(--shadow--x, 0) !default; -$shadow--y: props.def(--shadow--y, 1px) !default; -$shadow--blur: props.def(--shadow--blur, 4px) !default; - -$rounding: props.def(--rounding, 4px) !default; - -$key-focus--outline-width: props.def(--key-focus--outline-width, props.get($border-width--thick)) !default; -$key-focus--border-width: props.def(--key-focus--border-width, props.get($border-width--medium)) !default; -$key-focus--border-offset: props.def(--key-focus--border-offset, props.get($border-width--medium)) !default; - -$heading--xxl: props.def(--heading--xxl, props.get($font-size--300)) !default; -$heading--xl: props.def(--heading--xl, props.get($font-size--200)) !default; -$heading--lg: props.def(--heading--lg, props.get($font-size--150)) !default; -$heading--md: props.def(--heading--md, props.get($font-size--100)) !default; -$heading--sm: props.def(--heading--sm, props.get($font-size--75)) !default; -$heading--xs: props.def(--heading--xs, props.get($font-size--50)) !default; -$heading--display--xxl: props.def(--heading--display--xxl, props.get($font-size--1100)) !default; -$heading--display--xl: props.def(--heading--display--xl, props.get($font-size--700)) !default; -$heading--display--lg: props.def(--heading--display--lg, props.get($font-size--300)) !default; -$heading--display--md: props.def(--heading--display--md, props.get($font-size--150)) !default; -$heading--display--sm: props.def(--heading--display--sm, props.get($font-size--75)) !default; -$heading--display--xs: props.def(--heading--display--xs, props.get($font-size--50)) !default; -$heading--display-sm--xxl: props.def(--heading--display-sm--xxl, props.get($font-size--900)) !default; -$heading--display-sm--xl: props.def(--heading--display-sm--xl, props.get($font-size--600)) !default; -$heading--display-sm--lg: props.def(--heading--display-sm--lg, props.get($font-size--200)) !default; -$heading--display-sm--md: props.def(--heading--display-sm--md, props.get($font-size--100)) !default; -$heading--display-sm--sm: props.def(--heading--display-sm--sm, props.get($font-size--75)) !default; -$heading--display-sm--xs: props.def(--heading--display-sm--xs, props.get($font-size--50)) !default; - -$list--indent: props.def(--list--indent, props.get($size--400)) !default; -$list--compact-indent: props.def(--list--indent, props.get($size--250)) !default; - -// - -$static-colors: props.def(--static-colors); - -@each $palette-name, $palette in map.get(themes.$static-colors, --palettes) { - $palette: fn.palette($palette, map.get(themes.$static-colors, --contrasts), 1, map.get(themes.$static-colors, --base)); - $static-colors: props.merge($static-colors, ( $palette-name: $palette )); -} - -// - -$transparent-colors: props.def(--transparent-colors); - -@each $palette-name, $palette in (--black: #000 #fff, --white: #fff #000) { - $color: list.nth($palette, 1); - $text: list.nth($palette, 2); - - $palette: fn.transparent-palette($color, $text, map.get(themes.$static-colors, --transparents)); - $transparent-colors: props.merge($transparent-colors, ( $palette-name: $palette )); -} - -// - -$themes: (); - -@each $theme-name, $theme in themes.$themes { - @each $variant-name, $variant in $theme { - $compiled: props.def(--colors); - - @each $palette-name, $palette in map.get($variant, --palettes) { - $base-color: list.nth($palette, 1); - $contrasts: list.nth($palette, 2); - $ranges: list.nth($palette, 3); - - $palette: fn.palette($base-color, map.get($variant, --contrasts, $contrasts), map.get($variant, --ranges, $ranges), list.nth(map.get($variant, --palettes, --base), 1)); - $compiled: props.merge($compiled, ( $palette-name: $palette )); - } - - @each $color, $value in map.get($variant, --constants) { - $compiled: props.merge($compiled, ( $color: $value )); - } - - @each $color, $ref in map.get($variant, --semantic) { - $res: (); - - @if meta.type-of($ref) == 'map' { - @each $key, $r in $ref { - $repo-name: list.nth($r, 1); - $re1: list.nth($r, 2); - $re2: iro.fn-list-slice($r, 3); - - $res2: null; - - @if $repo-name == --static { - $res2: props.get($static-colors, $re1, $re2...); - } @else { - $res2: props.get($compiled, $re1, $re2...); - } - - $res: map.merge($res, ($key: $res2)); - } - } @else { - $repo-name: list.nth($ref, 1); - $ref1: list.nth($ref, 2); - $ref2: iro.fn-list-slice($ref, 3); - - $res: null; - - @if $repo-name == --static { - $res: props.get($static-colors, $ref1, $ref2...); - } @else { - $res: props.get($compiled, $ref1, $ref2...); - } - } - - $compiled: props.merge($compiled, ( $color: $res )); - } - - $themes: map.set($themes, $theme-name, $variant-name, $compiled); - } -} - -$theme: map.get($themes, themes.$theme-default, light) !default; diff --git a/src/layouts/_button-group.vars.scss b/src/layouts/_button-group.vars.scss index ac57b44..23b09c0 100644 --- a/src/layouts/_button-group.vars.scss +++ b/src/layouts/_button-group.vars.scss @@ -1,4 +1,4 @@ @use '../props'; -@use '../vars'; +@use '../core'; -$spacing: props.def(--l-button-group--spacing, props.get(vars.$size--150)) !default; +$spacing: props.def(--l-button-group--spacing, props.get(core.$size--150)) !default; diff --git a/src/layouts/_card-list.vars.scss b/src/layouts/_card-list.vars.scss index b3aaac4..16be23e 100644 --- a/src/layouts/_card-list.vars.scss +++ b/src/layouts/_card-list.vars.scss @@ -1,19 +1,19 @@ @use '../props'; -@use '../vars'; +@use '../core'; -$row-gap: props.def(--l-card-list--row-gap, props.get(vars.$size--800)) !default; -$col-gap: props.def(--l-card-list--col-gap, props.get(vars.$size--400)) !default; +$row-gap: props.def(--l-card-list--row-gap, props.get(core.$size--800)) !default; +$col-gap: props.def(--l-card-list--col-gap, props.get(core.$size--400)) !default; -$grid--row-gap: props.def(--l-card-list--grid--row-gap, props.get(vars.$size--800)) !default; -$grid--col-gap: props.def(--l-card-list--grid--col-gap, props.get(vars.$size--400)) !default; -$grid--col-width: props.def(--l-card-list--grid--col-width, props.get(vars.$size--3200)) !default; +$grid--row-gap: props.def(--l-card-list--grid--row-gap, props.get(core.$size--800)) !default; +$grid--col-gap: props.def(--l-card-list--grid--col-gap, props.get(core.$size--400)) !default; +$grid--col-width: props.def(--l-card-list--grid--col-width, props.get(core.$size--3200)) !default; -$masonry--row-gap: props.def(--l-card-list--masonry--row-gap, props.get(vars.$size--800)) !default; -$masonry--col-gap: props.def(--l-card-list--masonry--col-gap, props.get(vars.$size--400)) !default; -$masonry--col-width: props.def(--l-card-list--masonry--col-width, props.get(vars.$size--3200)) !default; +$masonry--row-gap: props.def(--l-card-list--masonry--row-gap, props.get(core.$size--800)) !default; +$masonry--col-gap: props.def(--l-card-list--masonry--col-gap, props.get(core.$size--400)) !default; +$masonry--col-width: props.def(--l-card-list--masonry--col-width, props.get(core.$size--3200)) !default; -$masonry-h--row-gap: props.def(--l-card-list--masonry-h--row-gap, props.get(vars.$size--800)) !default; -$masonry-h--col-gap: props.def(--l-card-list--masonry-h--col-gap, props.get(vars.$size--400)) !default; -$masonry-h--row-height: props.def(--l-card-list--masonry-h--row-height, props.get(vars.$size--3200)) !default; +$masonry-h--row-gap: props.def(--l-card-list--masonry-h--row-gap, props.get(core.$size--800)) !default; +$masonry-h--col-gap: props.def(--l-card-list--masonry-h--col-gap, props.get(core.$size--400)) !default; +$masonry-h--row-height: props.def(--l-card-list--masonry-h--row-height, props.get(core.$size--3200)) !default; -$border-color: props.def(--l-card-list--border-color, props.get(vars.$theme, --border)) !default; +$border-color: props.def(--l-card-list--border-color, props.get(core.$theme, --border)) !default; diff --git a/src/layouts/_container.vars.scss b/src/layouts/_container.vars.scss index 8b2258a..a80a909 100644 --- a/src/layouts/_container.vars.scss +++ b/src/layouts/_container.vars.scss @@ -1,6 +1,6 @@ @use 'iro-sass/src/iro-sass' as iro; @use '../props'; -@use '../vars'; +@use '../core'; $fixed-125: props.def(--l-container--fixed-125, iro.fn-px-to-rem(720px)) !default; $fixed: props.def(--l-container--fixed, iro.fn-px-to-rem(610px)) !default; @@ -12,11 +12,11 @@ $fixed-sizes: ( 'fixed-75': $fixed-75 ) !default; -$pad-i: props.def(--l-container--pad-i, props.get(vars.$size--400)) !default; -$pad-b: props.def(--l-container--pad-b, props.get(vars.$size--800)) !default; +$pad-i: props.def(--l-container--pad-i, props.get(core.$size--400)) !default; +$pad-b: props.def(--l-container--pad-b, props.get(core.$size--800)) !default; -$pad-i--sm: props.def(--l-container--pad-i, props.get(vars.$size--200), 'sm') !default; -$pad-b--sm: props.def(--l-container--pad-b, props.get(vars.$size--600), 'sm') !default; +$pad-i--sm: props.def(--l-container--pad-i, props.get(core.$size--200), 'sm') !default; +$pad-b--sm: props.def(--l-container--pad-b, props.get(core.$size--600), 'sm') !default; -$pad-i--xs: props.def(--l-container--pad-i, props.get(vars.$size--150), 'xs') !default; -$pad-b--xs: props.def(--l-container--pad-b, props.get(vars.$size--450), 'xs') !default; +$pad-i--xs: props.def(--l-container--pad-i, props.get(core.$size--150), 'xs') !default; +$pad-b--xs: props.def(--l-container--pad-b, props.get(core.$size--450), 'xs') !default; diff --git a/src/layouts/_form.vars.scss b/src/layouts/_form.vars.scss index 45faf29..a46a337 100644 --- a/src/layouts/_form.vars.scss +++ b/src/layouts/_form.vars.scss @@ -1,5 +1,5 @@ @use '../props'; -@use '../vars'; +@use '../core'; -$item-spacing-b: props.def(--l-form--item-spacing-b, props.get(vars.$size--325)) !default; -$label-spacing-i: props.def(--l-form--label-spacing-i, props.get(vars.$size--325)) !default; +$item-spacing-b: props.def(--l-form--item-spacing-b, props.get(core.$size--325)) !default; +$label-spacing-i: props.def(--l-form--label-spacing-i, props.get(core.$size--325)) !default; diff --git a/src/layouts/_media.vars.scss b/src/layouts/_media.vars.scss index 3444611..55961b8 100644 --- a/src/layouts/_media.vars.scss +++ b/src/layouts/_media.vars.scss @@ -1,12 +1,12 @@ @use '../props'; -@use '../vars'; +@use '../core'; -$gap: props.def(--l-media--gap, props.get(vars.$size--150)) !default; +$gap: props.def(--l-media--gap, props.get(core.$size--150)) !default; $gapless: props.def(--l-media--gapless, 0) !default; -$sm: props.def(--l-media--sm, props.get(vars.$size--100)) !default; -$lg: props.def(--l-media--lg, props.get(vars.$size--300)) !default; -$xl: props.def(--l-media--xl, props.get(vars.$size--450)) !default; +$sm: props.def(--l-media--sm, props.get(core.$size--100)) !default; +$lg: props.def(--l-media--lg, props.get(core.$size--300)) !default; +$xl: props.def(--l-media--xl, props.get(core.$size--450)) !default; $sizes: ( 'gapless': $gapless, diff --git a/src/layouts/_overflow.scss b/src/layouts/_overflow.scss index 2589d2c..310c7ee 100644 --- a/src/layouts/_overflow.scss +++ b/src/layouts/_overflow.scss @@ -1,11 +1,11 @@ @use 'iro-sass/src/iro-sass' as iro; @use '../props'; -@use '../vars'; +@use '../core'; @mixin styles { @include iro.bem-layout('overflow') { overflow: auto; - scrollbar-color: props.get(vars.$theme, --text-disabled) transparent; + scrollbar-color: props.get(core.$theme, --text-disabled) transparent; } } diff --git a/src/objects/_action-button.vars.scss b/src/objects/_action-button.vars.scss index 16d9e7f..d1b3a4a 100644 --- a/src/objects/_action-button.vars.scss +++ b/src/objects/_action-button.vars.scss @@ -1,33 +1,33 @@ @use 'sass:map'; @use '../props'; -@use '../vars'; +@use '../core'; $line-height: props.def(--o-action-button--line-height, 1.4) !default; -$pad-i: props.def(--o-action-button--pad-i, props.get(vars.$size--150)) !default; -$pad-i-pill: props.def(--o-action-button--pad-i-pill, props.get(vars.$size--200)) !default; -$pad-b: props.def(--o-action-button--pad-b, props.get(vars.$size--85)) !default; -$border-width: props.def(--o-action-button--border-width, props.get(vars.$border-width--thin)) !default; -$rounding: props.def(--o-action-button--rounding, props.get(vars.$rounding)) !default; -$font-size: props.def(--o-action-button--font-size, props.get(vars.$font-size--100)) !default; - -$pad-i--sm: props.def(--o-action-button--pad-i, props.get(vars.$size--100), 'sm') !default; -$pad-i-pill--sm: props.def(--o-action-button--pad-i-pill, props.get(vars.$size--150), 'sm') !default; -$pad-b--sm: props.def(--o-action-button--pad-b, props.get(vars.$size--40), 'sm') !default; -$font-size--sm: props.def(--o-action-button--font-size, props.get(vars.$font-size--75), 'sm') !default; - -$pad-i--lg: props.def(--o-action-button--pad-i, props.get(vars.$size--175), 'lg') !default; -$pad-i-pill--lg: props.def(--o-action-button--pad-i-pill, props.get(vars.$size--225), 'lg') !default; -$pad-b--lg: props.def(--o-action-button--pad-b, props.get(vars.$size--115), 'lg') !default; -$font-size--lg: props.def(--o-action-button--font-size, props.get(vars.$font-size--150), 'lg') !default; - -$pad-i--xl: props.def(--o-action-button--pad-i, props.get(vars.$size--225), 'xl') !default; -$pad-i-pill--xl: props.def(--o-action-button--pad-i-pill, props.get(vars.$size--300), 'xl') !default; -$pad-b--xl: props.def(--o-action-button--pad-b, props.get(vars.$size--150), 'xl') !default; -$font-size--xl: props.def(--o-action-button--font-size, props.get(vars.$font-size--200), 'xl') !default; - -$key-focus--border-width: props.def(--o-action-button--key-focus--border-width, props.get(vars.$key-focus--border-width)) !default; -$key-focus--border-offset: props.def(--o-action-button--key-focus--border-offset, props.get(vars.$key-focus--border-offset)) !default; -$key-focus--outline-width: props.def(--o-action-button--key-focus--outline-width, props.get(vars.$key-focus--outline-width)) !default; +$pad-i: props.def(--o-action-button--pad-i, props.get(core.$size--150)) !default; +$pad-i-pill: props.def(--o-action-button--pad-i-pill, props.get(core.$size--200)) !default; +$pad-b: props.def(--o-action-button--pad-b, props.get(core.$size--85)) !default; +$border-width: props.def(--o-action-button--border-width, props.get(core.$border-width--thin)) !default; +$rounding: props.def(--o-action-button--rounding, props.get(core.$rounding)) !default; +$font-size: props.def(--o-action-button--font-size, props.get(core.$font-size--100)) !default; + +$pad-i--sm: props.def(--o-action-button--pad-i, props.get(core.$size--100), 'sm') !default; +$pad-i-pill--sm: props.def(--o-action-button--pad-i-pill, props.get(core.$size--150), 'sm') !default; +$pad-b--sm: props.def(--o-action-button--pad-b, props.get(core.$size--40), 'sm') !default; +$font-size--sm: props.def(--o-action-button--font-size, props.get(core.$font-size--75), 'sm') !default; + +$pad-i--lg: props.def(--o-action-button--pad-i, props.get(core.$size--175), 'lg') !default; +$pad-i-pill--lg: props.def(--o-action-button--pad-i-pill, props.get(core.$size--225), 'lg') !default; +$pad-b--lg: props.def(--o-action-button--pad-b, props.get(core.$size--115), 'lg') !default; +$font-size--lg: props.def(--o-action-button--font-size, props.get(core.$font-size--150), 'lg') !default; + +$pad-i--xl: props.def(--o-action-button--pad-i, props.get(core.$size--225), 'xl') !default; +$pad-i-pill--xl: props.def(--o-action-button--pad-i-pill, props.get(core.$size--300), 'xl') !default; +$pad-b--xl: props.def(--o-action-button--pad-b, props.get(core.$size--150), 'xl') !default; +$font-size--xl: props.def(--o-action-button--font-size, props.get(core.$font-size--200), 'xl') !default; + +$key-focus--border-width: props.def(--o-action-button--key-focus--border-width, props.get(core.$key-focus--border-width)) !default; +$key-focus--border-offset: props.def(--o-action-button--key-focus--border-offset, props.get(core.$key-focus--border-offset)) !default; +$key-focus--outline-width: props.def(--o-action-button--key-focus--outline-width, props.get(core.$key-focus--outline-width)) !default; $fixed-sizes: ( 'sm' $pad-i--sm $pad-i-pill--sm $pad-b--sm $font-size--sm, @@ -35,149 +35,151 @@ $fixed-sizes: ( 'xl' $pad-i--xl $pad-i-pill--xl $pad-b--xl $font-size--xl, ) !default; -$default-theme: props.def(--o-action-button, ( - --bg-color: props.get(vars.$theme, --base, --75), - --label-color: props.get(vars.$theme, --text), - --border-color: props.get(vars.$theme, --border-strong), +$default-theme-override: () !default; +$default-theme: map.deep-merge(( + --bg-color: props.get(core.$theme, --base, --75), + --label-color: props.get(core.$theme, --text), + --border-color: props.get(core.$theme, --border-strong), --hover: ( - --bg-color: props.get(vars.$theme, --border-mute), - --label-color: props.get(vars.$theme, --heading), - --border-color: props.get(vars.$theme, --text-mute-more), + --bg-color: props.get(core.$theme, --border-mute), + --label-color: props.get(core.$theme, --heading), + --border-color: props.get(core.$theme, --text-mute-more), ), --active: ( - --bg-color: props.get(vars.$theme, --border), - --label-color: props.get(vars.$theme, --heading), - --border-color: props.get(vars.$theme, --text-mute), + --bg-color: props.get(core.$theme, --border), + --label-color: props.get(core.$theme, --heading), + --border-color: props.get(core.$theme, --text-mute), ), --disabled: ( - --bg-color: props.get(vars.$theme, --bg-l1), - --label-color: props.get(vars.$theme, --border-strong), - --border-color: props.get(vars.$theme, --border), + --bg-color: props.get(core.$theme, --bg-l1), + --label-color: props.get(core.$theme, --border-strong), + --border-color: props.get(core.$theme, --border), ), --key-focus: ( - --border-color: props.get(vars.$theme, --focus, --border), - --outline-color: props.get(vars.$theme, --focus, --outline), + --border-color: props.get(core.$theme, --focus, --border), + --outline-color: props.get(core.$theme, --focus, --outline), ), --selected: ( - --bg-color: props.get(vars.$theme, --text-mute), - --label-color: props.get(vars.$theme, --base, --50), - --border-color: props.get(vars.$theme, --text-mute), + --bg-color: props.get(core.$theme, --text-mute), + --label-color: props.get(core.$theme, --base, --50), + --border-color: props.get(core.$theme, --text-mute), --hover: ( - --bg-color: props.get(vars.$theme, --text), - --label-color: props.get(vars.$theme, --base, --50), - --border-color: props.get(vars.$theme, --text), + --bg-color: props.get(core.$theme, --text), + --label-color: props.get(core.$theme, --base, --50), + --border-color: props.get(core.$theme, --text), ), --active: ( - --bg-color: props.get(vars.$theme, --heading), - --label-color: props.get(vars.$theme, --base, --50), - --border-color: props.get(vars.$theme, --heading), + --bg-color: props.get(core.$theme, --heading), + --label-color: props.get(core.$theme, --base, --50), + --border-color: props.get(core.$theme, --heading), ), --disabled: ( - --bg-color: props.get(vars.$theme, --border-mute), - --label-color: props.get(vars.$theme, --border-strong), - --border-color: props.get(vars.$theme, --border-mute), + --bg-color: props.get(core.$theme, --border-mute), + --label-color: props.get(core.$theme, --border-strong), + --border-color: props.get(core.$theme, --border-mute), ), ), --quiet: ( - --label-color: props.get(vars.$theme, --text), + --label-color: props.get(core.$theme, --text), --hover: ( - --bg-color: props.get(vars.$theme, --border-mute), - --label-color: props.get(vars.$theme, --heading), + --bg-color: props.get(core.$theme, --border-mute), + --label-color: props.get(core.$theme, --heading), ), --active: ( - --bg-color: props.get(vars.$theme, --border), - --label-color: props.get(vars.$theme, --heading), + --bg-color: props.get(core.$theme, --border), + --label-color: props.get(core.$theme, --heading), ), --disabled: ( - --label-color: props.get(vars.$theme, --border-strong), + --label-color: props.get(core.$theme, --border-strong), ), ), -)) !default; +), $default-theme-override) !default; +$default-theme: props.def(--o-action-button, $default-theme); $static-themes: props.def(--o-action-button); -@each $theme in map.keys(props.get(vars.$transparent-colors)) { +@each $theme in map.keys(props.get(core.$transparent-colors)) { $button-theme: #{$theme}-static; $static-themes: props.merge($static-themes, ( $button-theme: ( - --bg-color: props.get(vars.$transparent-colors, $theme, --100), - --label-color: props.get(vars.$transparent-colors, $theme, --900), - --border-color: props.get(vars.$transparent-colors, $theme, --400), + --bg-color: props.get(core.$transparent-colors, $theme, --100), + --label-color: props.get(core.$transparent-colors, $theme, --900), + --border-color: props.get(core.$transparent-colors, $theme, --400), --hover: ( - --bg-color: props.get(vars.$transparent-colors, $theme, --300), - --label-color: props.get(vars.$transparent-colors, $theme, --900), - --border-color: props.get(vars.$transparent-colors, $theme, --500), + --bg-color: props.get(core.$transparent-colors, $theme, --300), + --label-color: props.get(core.$transparent-colors, $theme, --900), + --border-color: props.get(core.$transparent-colors, $theme, --500), ), --active: ( - --bg-color: props.get(vars.$transparent-colors, $theme, --400), - --label-color: props.get(vars.$transparent-colors, $theme, --900), - --border-color: props.get(vars.$transparent-colors, $theme, --600), + --bg-color: props.get(core.$transparent-colors, $theme, --400), + --label-color: props.get(core.$transparent-colors, $theme, --900), + --border-color: props.get(core.$transparent-colors, $theme, --600), ), --disabled: ( - --bg-color: props.get(vars.$transparent-colors, $theme, --100), - --label-color: props.get(vars.$transparent-colors, $theme, --500), - --border-color: props.get(vars.$transparent-colors, $theme, --300), + --bg-color: props.get(core.$transparent-colors, $theme, --100), + --label-color: props.get(core.$transparent-colors, $theme, --500), + --border-color: props.get(core.$transparent-colors, $theme, --300), ), --key-focus: ( - --border-color: props.get(vars.$transparent-colors, $theme, --900), - --outline-color: props.get(vars.$transparent-colors, $theme, --300), + --border-color: props.get(core.$transparent-colors, $theme, --900), + --outline-color: props.get(core.$transparent-colors, $theme, --300), ), --selected: ( - --bg-color: props.get(vars.$transparent-colors, $theme, --800), - --label-color: props.get(vars.$transparent-colors, $theme, --text), - --border-color: props.get(vars.$transparent-colors, $theme, --100), + --bg-color: props.get(core.$transparent-colors, $theme, --800), + --label-color: props.get(core.$transparent-colors, $theme, --text), + --border-color: props.get(core.$transparent-colors, $theme, --100), --hover: ( - --bg-color: props.get(vars.$transparent-colors, $theme, --900), - --label-color: props.get(vars.$transparent-colors, $theme, --text), - --border-color: props.get(vars.$transparent-colors, $theme, --100), + --bg-color: props.get(core.$transparent-colors, $theme, --900), + --label-color: props.get(core.$transparent-colors, $theme, --text), + --border-color: props.get(core.$transparent-colors, $theme, --100), ), --active: ( - --bg-color: props.get(vars.$transparent-colors, $theme, --900), - --label-color: props.get(vars.$transparent-colors, $theme, --text), - --border-color: props.get(vars.$transparent-colors, $theme, --100), + --bg-color: props.get(core.$transparent-colors, $theme, --900), + --label-color: props.get(core.$transparent-colors, $theme, --text), + --border-color: props.get(core.$transparent-colors, $theme, --100), ), --disabled: ( - --bg-color: props.get(vars.$transparent-colors, $theme, --200), - --label-color: props.get(vars.$transparent-colors, $theme, --500), - --border-color: props.get(vars.$transparent-colors, $theme, --100), + --bg-color: props.get(core.$transparent-colors, $theme, --200), + --label-color: props.get(core.$transparent-colors, $theme, --500), + --border-color: props.get(core.$transparent-colors, $theme, --100), ), ), --quiet: ( - --label-color: props.get(vars.$transparent-colors, $theme, --900), + --label-color: props.get(core.$transparent-colors, $theme, --900), --hover: ( - --bg-color: props.get(vars.$transparent-colors, $theme, --300), - --label-color: props.get(vars.$transparent-colors, $theme, --900), + --bg-color: props.get(core.$transparent-colors, $theme, --300), + --label-color: props.get(core.$transparent-colors, $theme, --900), ), --active: ( - --bg-color: props.get(vars.$transparent-colors, $theme, --400), - --label-color: props.get(vars.$transparent-colors, $theme, --900), + --bg-color: props.get(core.$transparent-colors, $theme, --400), + --label-color: props.get(core.$transparent-colors, $theme, --900), ), --disabled: ( - --label-color: props.get(vars.$transparent-colors, $theme, --500), + --label-color: props.get(core.$transparent-colors, $theme, --500), ), ), ) diff --git a/src/objects/_alert.scss b/src/objects/_alert.scss index 774b443..651ad23 100644 --- a/src/objects/_alert.scss +++ b/src/objects/_alert.scss @@ -1,42 +1,24 @@ +@use 'sass:map'; +@use 'sass:meta'; @use 'iro-sass/src/iro-sass' as iro; -@use '../functions' as fn; +@use '../props'; -$themes: 'accent' 'positive' 'negative' 'warning' !default; +@forward 'alert.vars'; +@use 'alert.vars' as vars; -@include iro.props-namespace('alert') { - @include iro.props-store(( - --dims: ( - --border: fn.global-dim(--border --medium), - --pad-i: fn.global-dim(--size --250), - --pad-b: fn.global-dim(--size --200), - --rounding: fn.global-dim(--rounding), - ), - --colors: ( - --bg: fn.global-color(--bg-l2), - --border: fn.global-color(--text-mute-more), - ), - )); +@mixin styles { + @include props.materialize(meta.module-variables('vars')); - @each $theme in $themes { - @include iro.props-store(( - --colors: ( - --#{$theme}: ( - --border: fn.global-color(--#{$theme} --700), - ), - ), - )); - } - - @include iro.bem-object(iro.props-namespace()) { - padding-block: fn.dim(--pad-b); - padding-inline: fn.dim(--pad-i); - background-color: fn.color(--bg); - border: fn.dim(--border) solid fn.color(--border); - border-radius: fn.dim(--rounding); + @include iro.bem-object('alert') { + padding-block: props.get(vars.$pad-b); + padding-inline: props.get(vars.$pad-i); + background-color: props.get(vars.$bg-color); + border: props.get(vars.$border-width) solid props.get(vars.$border-color); + border-radius: props.get(vars.$rounding); - @each $theme in $themes { - @include iro.bem-modifier($theme) { - border-color: fn.color(--#{$theme} --border); + @each $mod, $theme in vars.$themes { + @include iro.bem-modifier($mod) { + border-color: props.get(vars.$populated-themes, $theme, --border-color); } } } diff --git a/src/objects/_alert.vars.scss b/src/objects/_alert.vars.scss index e69de29..64d8f1f 100644 --- a/src/objects/_alert.vars.scss +++ b/src/objects/_alert.vars.scss @@ -0,0 +1,26 @@ +@use '../props'; +@use '../core'; + +$border-width: props.def(--o-alert--border-width, props.get(core.$border-width--medium)) !default; +$pad-i: props.def(--o-alert--pad-i, props.get(core.$size--250)) !default; +$pad-b: props.def(--o-alert--pad-b, props.get(core.$size--200)) !default; +$rounding: props.def(--o-alert--rounding, props.get(core.$rounding)) !default; + +$bg-color: props.def(--o-alert--bg-color, props.get(core.$theme, --bg-l2)) !default; +$border-color: props.def(--o-alert--bg-color, props.get(core.$theme, --text-mute-more)) !default; + +$themes: ( + accent: --accent, + positive: --positive, + negative: --negative, + warning: --warning, +) !default; + +$populated-themes: props.def(--o-alert); +@each $theme, $key in $themes { + $populated-themes: props.merge($populated-themes, ( + $key: ( + --border-color: props.get(core.$theme, $key, --700), + ) + )); +} diff --git a/src/objects/_avatar.scss b/src/objects/_avatar.scss index d9c1105..45567b9 100644 --- a/src/objects/_avatar.scss +++ b/src/objects/_avatar.scss @@ -1,101 +1,52 @@ -@use 'sass:list'; +@use 'sass:meta'; @use 'iro-sass/src/iro-sass' as iro; -@use '../functions' as fn; +@use '../props'; -$sizes: 'xs' 'sm' 'lg' 'xl' 'xxl' 'xxxl'; +@forward 'avatar.vars'; +@use 'avatar.vars' as vars; -@mixin status($size: ()) { +@mixin status($indicator-size) { @include iro.bem-elem('status') { - inline-size: fn.dim(list.join($size, --indicator-size)); - block-size: fn.dim(list.join($size, --indicator-size)); + inline-size: props.get($indicator-size); + block-size: props.get($indicator-size); @include iro.bem-next-elem('content') { - mask-image: radial-gradient(circle calc(.5 * fn.dim(list.join($size, --indicator-size)) + fn.dim(--indicator-spacing)) at - calc(100% - .5 * fn.dim(list.join($size, --indicator-size))) - calc(100% - .5 * fn.dim(list.join($size, --indicator-size))), - transparent 95%, - #fff); + mask-image: radial-gradient(circle calc(.5 * props.get($indicator-size) + props.get(vars.$indicator-spacing)) at + calc(100% - .5 * props.get($indicator-size)) + calc(100% - .5 * props.get($indicator-size)), + transparent 95%, + #fff); } } } -@include iro.props-namespace('avatar') { - @include iro.props-store(( - --dims: ( - --size: fn.global-dim(--size --500), - --font-size: fn.global-dim(--font-size --100), - --indicator-size: fn.global-dim(--size --150), - --indicator-spacing: fn.global-dim(--size --40), - --rounding: 25%, +@mixin styles { + @include props.materialize(meta.module-variables('vars')); - --xxxl: ( - --size: fn.global-dim(--size --1600), - --font-size: fn.global-dim(--font-size --800), - --indicator-size: fn.global-dim(--size --400), - ), - --xxl: ( - --size: fn.global-dim(--size --1200), - --font-size: fn.global-dim(--font-size --600), - --indicator-size: fn.global-dim(--size --300), - ), - --xl: ( - --size: fn.global-dim(--size --800), - --font-size: fn.global-dim(--font-size --300), - --indicator-size: fn.global-dim(--size --225), - ), - --lg: ( - --size: fn.global-dim(--size --650), - --font-size: fn.global-dim(--font-size --200), - --indicator-size: fn.global-dim(--size --175), - ), - --sm: ( - --size: fn.global-dim(--size --375), - --font-size: fn.global-dim(--font-size --75), - --indicator-size: fn.global-dim(--size --125), - ), - --xs: ( - --size: fn.global-dim(--size --250), - --font-size: fn.global-dim(--font-size --50), - --indicator-size: fn.global-dim(--size --100), - ), - - --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: ( - --h: 354, - --s: 44%, - --l: 45%, - - --key-focus: ( - --border: fn.global-color(--focus --border), - --outline: fn.global-color(--focus --outline), - ), - ), - )); - - @include iro.bem-object(iro.props-namespace()) { + @include iro.bem-object('avatar') { position: relative; display: inline-block; - font-size: fn.dim(--font-size); + font-size: props.get(vars.$font-size); font-style: normal; vertical-align: .05em; - border-radius: fn.dim(--rounding); + border-radius: props.get(vars.$rounding); &::after { position: absolute; - inset: calc(-1 * fn.dim(--key-focus --border-offset)); + inset: calc(-1 * props.get(vars.$key-focus--border-offset)); z-index: 1; display: none; pointer-events: none; content: ''; - border: fn.dim(--key-focus --border-offset) solid transparent; - border-radius: fn.dim(--rounding); - 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); + border: props.get(vars.$key-focus--border-offset) solid transparent; + border-radius: props.get(vars.$rounding); + outline: props.get(vars.$key-focus--border-color) solid props.get(vars.$key-focus--border-width); + box-shadow: + 0 + 0 + 0 + calc(props.get(vars.$key-focus--border-width) + props.get(vars.$key-focus--outline-width)) + props.get(vars.$key-focus--outline-color); } @include iro.bem-elem('status') { @@ -104,17 +55,17 @@ $sizes: 'xs' 'sm' 'lg' 'xl' 'xxl' 'xxxl'; inset-inline-end: 0; } - @include status; + @include status(vars.$indicator-size); @include iro.bem-elem('content') { display: block; - inline-size: fn.dim(--size); - block-size: fn.dim(--size); - line-height: fn.dim(--size); + inline-size: props.get(vars.$size); + block-size: props.get(vars.$size); + line-height: props.get(vars.$size); text-align: center; object-fit: cover; object-position: center center; - border-radius: fn.dim(--rounding); + border-radius: props.get(vars.$rounding); } @include iro.bem-modifier('circle') { @@ -131,27 +82,27 @@ $sizes: 'xs' 'sm' 'lg' 'xl' 'xxl' 'xxxl'; @include iro.bem-modifier('placeholder') { @include iro.bem-elem('content') { - background-color: hsl(0, 0%, fn.color(--l)); + background-color: hsl(0, 0%, props.get(vars.$bg-color--l)); } } @include iro.bem-modifier('colored') { @include iro.bem-elem('content') { color: #fff; - background-color: hsl(fn.color(--h), fn.color(--s), fn.color(--l)); + background-color: hsl(props.get(vars.$bg-color--h), props.get(vars.$bg-color--s), props.get(vars.$bg-color--l)); } } - @each $size in $sizes { - @include iro.bem-modifier($size) { - font-size: fn.dim(--#{$size} --font-size); + @each $mod, $size, $font-size, $indicator-size in vars.$sizes { + @include iro.bem-modifier($mod) { + font-size: props.get($font-size); - @include status(--#{$size}); + @include status($indicator-size); @include iro.bem-elem('content') { - inline-size: fn.dim(--#{$size} --size); - block-size: fn.dim(--#{$size} --size); - line-height: fn.dim(--#{$size} --size); + inline-size: props.get($size); + block-size: props.get($size); + line-height: props.get($size); } } } diff --git a/src/objects/_avatar.vars.scss b/src/objects/_avatar.vars.scss new file mode 100644 index 0000000..5b97ec8 --- /dev/null +++ b/src/objects/_avatar.vars.scss @@ -0,0 +1,52 @@ +@use '../props'; +@use '../core'; + +$size: props.def(--o-avatar--size, props.get(core.$size--500)) !default; +$font-size: props.def(--o-avatar--font-size, props.get(core.$font-size--100)) !default; +$indicator-size: props.def(--o-avatar--indicator-size, props.get(core.$size--150)) !default; +$indicator-spacing: props.def(--o-avatar--indicator-spacing, props.get(core.$size--40)) !default; +$rounding: props.def(--o-avatar--rounding, 25%) !default; + +$size--xxxl: props.def(--o-avatar--xxxl--size, props.get(core.$size--1600)) !default; +$font-size--xxxl: props.def(--o-avatar--xxxl--font-size, props.get(core.$font-size--800)) !default; +$indicator-size--xxxl: props.def(--o-avatar--xxxl--indicator-size, props.get(core.$size--400)) !default; + +$size--xxl: props.def(--o-avatar--xxl--size, props.get(core.$size--1200)) !default; +$font-size--xxl: props.def(--o-avatar--xxl--font-size, props.get(core.$font-size--600)) !default; +$indicator-size--xxl: props.def(--o-avatar--xxl--indicator-size, props.get(core.$size--300)) !default; + +$size--xl: props.def(--o-avatar--xl--size, props.get(core.$size--800)) !default; +$font-size--xl: props.def(--o-avatar--xl--font-size, props.get(core.$font-size--300)) !default; +$indicator-size--xl: props.def(--o-avatar--xl--indicator-size, props.get(core.$size--225)) !default; + +$size--lg: props.def(--o-avatar--lg--size, props.get(core.$size--650)) !default; +$font-size--lg: props.def(--o-avatar--lg--font-size, props.get(core.$font-size--200)) !default; +$indicator-size--lg: props.def(--o-avatar--lg--indicator-size, props.get(core.$size--175)) !default; + +$size--sm: props.def(--o-avatar--sm--size, props.get(core.$size--375)) !default; +$font-size--sm: props.def(--o-avatar--sm--font-size, props.get(core.$font-size--75)) !default; +$indicator-size--sm: props.def(--o-avatar--sm--indicator-size, props.get(core.$size--125)) !default; + +$size--xs: props.def(--o-avatar--xs--size, props.get(core.$size--250)) !default; +$font-size--xs: props.def(--o-avatar--xs--font-size, props.get(core.$font-size--50)) !default; +$indicator-size--xs: props.def(--o-avatar--xs--indicator-size, props.get(core.$size--100)) !default; + +$key-focus--border-width: props.def(--o-avatar--key-focus--border-width, props.get(core.$key-focus--border-width)) !default; +$key-focus--border-offset: props.def(--o-avatar--key-focus--border-offset, props.get(core.$key-focus--border-offset)) !default; +$key-focus--outline-width: props.def(--o-avatar--key-focus--outline-width, props.get(core.$key-focus--outline-width)) !default; + +$bg-color--h: props.def(--o-avatar--bg-color--h, 354) !default; +$bg-color--s: props.def(--o-avatar--bg-color--s, 44%) !default; +$bg-color--l: props.def(--o-avatar--bg-color--l, 45%) !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; + +$sizes: ( + 'xs' $size--xs $font-size--xs $indicator-size--xs, + 'sm' $size--sm $font-size--sm $indicator-size--sm, + 'lg' $size--lg $font-size--lg $indicator-size--lg, + 'xl' $size--xl $font-size--xl $indicator-size--xl, + 'xxl' $size--xxl $font-size--xxl $indicator-size--xxl, + 'xxxl' $size--xxxl $font-size--xxxl $indicator-size--xxxl, +) !default; diff --git a/src/objects/_heading.scss b/src/objects/_heading.scss index 7fbafea..8ed3b17 100644 --- a/src/objects/_heading.scss +++ b/src/objects/_heading.scss @@ -31,10 +31,10 @@ $sizes: 'xxl' 'xl' 'lg' 'md' 'sm' 'xs'; @include iro.bem-elem('highlight') { background-image: linear-gradient(to top, - transparent .05em, - fn.color(--bg) .05em, - fn.color(--bg) .5em, - transparent .5em); + transparent .05em, + fn.color(--bg) .05em, + fn.color(--bg) .5em, + transparent .5em); } @include iro.bem-modifier('xxl') { diff --git a/src/scopes/_blockquotes.vars.scss b/src/scopes/_blockquotes.vars.scss index a3f8d85..108392d 100644 --- a/src/scopes/_blockquotes.vars.scss +++ b/src/scopes/_blockquotes.vars.scss @@ -1,11 +1,11 @@ @use '../props'; -@use '../vars'; -@use './implicit.vars' as implicit-vars; +@use '../core'; +@use './implicit' as implicit; -$indent: props.def(--s-blockquotes--indent, props.get(vars.$list--indent)) !default; -$margin-bs: props.def(--s-blockquotes--margin-bs, props.get(implicit-vars.$paragraph--margin-bs)) !default; -$border-width: props.def(--s-blockquotes--border-width, props.get(vars.$border-width--thick)) !default; +$indent: props.def(--s-blockquotes--indent, props.get(core.$list--indent)) !default; +$margin-bs: props.def(--s-blockquotes--margin-bs, props.get(implicit.$paragraph--margin-bs)) !default; +$border-width: props.def(--s-blockquotes--border-width, props.get(core.$border-width--thick)) !default; -$compact--indent: props.def(--s-blockquotes--compact--indent, props.get(vars.$list--compact-indent)) !default; +$compact--indent: props.def(--s-blockquotes--compact--indent, props.get(core.$list--compact-indent)) !default; -$border-color: props.def(--s-blockquotes--border-width, props.get(vars.$theme, --border)) !default; +$border-color: props.def(--s-blockquotes--border-width, props.get(core.$theme, --border)) !default; diff --git a/src/scopes/_code.vars.scss b/src/scopes/_code.vars.scss index 27d75f7..7f31b8c 100644 --- a/src/scopes/_code.vars.scss +++ b/src/scopes/_code.vars.scss @@ -1,18 +1,18 @@ @use '../props'; -@use '../vars'; -@use './implicit.vars' as implicit-vars; +@use '../core'; +@use './implicit' as implicit; -$inline--pad-i: props.def(--s-code--inline--pad-i, props.get(vars.$size--50)) !default; -$inline--pad-b: props.def(--s-code--inline--pad-b, props.get(vars.$size--10)) !default; -$inline--rounding: props.def(--s-code--inline--rounding, props.get(vars.$rounding)) !default; +$inline--pad-i: props.def(--s-code--inline--pad-i, props.get(core.$size--50)) !default; +$inline--pad-b: props.def(--s-code--inline--pad-b, props.get(core.$size--10)) !default; +$inline--rounding: props.def(--s-code--inline--rounding, props.get(core.$rounding)) !default; -$block--pad-i: props.def(--s-code--block--pad-i, props.get(vars.$size--150)) !default; -$block--pad-b: props.def(--s-code--block--pad-b, props.get(vars.$size--85)) !default; -$block--margin-bs: props.def(--s-code--block--margin-bs, props.get(implicit-vars.$paragraph--margin-bs)) !default; -$block--rounding: props.def(--s-code--block--rounding, props.get(vars.$rounding)) !default; +$block--pad-i: props.def(--s-code--block--pad-i, props.get(core.$size--150)) !default; +$block--pad-b: props.def(--s-code--block--pad-b, props.get(core.$size--85)) !default; +$block--margin-bs: props.def(--s-code--block--margin-bs, props.get(implicit.$paragraph--margin-bs)) !default; +$block--rounding: props.def(--s-code--block--rounding, props.get(core.$rounding)) !default; -$inline--fg: props.def(--s-code--inline--fg, props.get(vars.$theme, --red, --1200)) !default; -$inline--bg: props.def(--s-code--inline--bg, props.get(vars.$theme, --red, --200)) !default; +$inline--fg: props.def(--s-code--inline--fg, props.get(core.$theme, --red, --1200)) !default; +$inline--bg: props.def(--s-code--inline--bg, props.get(core.$theme, --red, --200)) !default; -$block--fg: props.def(--s-code--block--fg, props.get(vars.$theme, --text)) !default; -$block--bg: props.def(--s-code--block--bg, props.get(vars.$theme, --base, --50)) !default; +$block--fg: props.def(--s-code--block--fg, props.get(core.$theme, --text)) !default; +$block--bg: props.def(--s-code--block--bg, props.get(core.$theme, --base, --50)) !default; diff --git a/src/scopes/_headings.scss b/src/scopes/_headings.scss index e97e9f2..002a392 100644 --- a/src/scopes/_headings.scss +++ b/src/scopes/_headings.scss @@ -2,7 +2,7 @@ @use 'iro-sass/src/iro-sass' as iro; @use '../mixins' as mx; @use '../props'; -@use '../vars'; +@use '../core'; @mixin styles { @include iro.bem-scope('headings') { diff --git a/src/scopes/_implicit.scss b/src/scopes/_implicit.scss index 9c17868..d679bdc 100644 --- a/src/scopes/_implicit.scss +++ b/src/scopes/_implicit.scss @@ -2,7 +2,7 @@ @use 'sass:meta'; @use 'iro-sass/src/iro-sass' as iro; @use '../props'; -@use '../vars' as global-vars; +@use '../core'; @forward 'implicit.vars'; @use 'implicit.vars' as vars; @@ -11,8 +11,8 @@ @include props.materialize(meta.module-variables('vars')); html { - accent-color: props.get(global-vars.$theme, --accent, --600); - scrollbar-color: props.get(global-vars.$theme, --text-disabled) transparent; + accent-color: props.get(core.$theme, --accent, --600); + scrollbar-color: props.get(core.$theme, --text-disabled) transparent; } html, @@ -25,8 +25,8 @@ padding: 0; margin: 0; - color: props.get(global-vars.$theme, --text); - background-color: props.get(global-vars.$theme, --bg-base); + color: props.get(core.$theme, --text); + background-color: props.get(core.$theme, --bg-base); } pre, @@ -77,7 +77,7 @@ } small { - font-size: props.get(global-vars.$font-size--75); + font-size: props.get(core.$font-size--75); } ul, @@ -130,23 +130,23 @@ input, textarea { &::placeholder { - color: props.get(global-vars.$theme, --text-mute); + color: props.get(core.$theme, --text-mute); opacity: 1; } &:disabled { - color: props.get(global-vars.$theme, --text-disabled); + color: props.get(core.$theme, --text-disabled); } } textarea { - block-size: calc(1em * props.get(global-vars.$font--standard--line-height)); + block-size: calc(1em * props.get(core.$font--standard--line-height)); } hr { - block-size: props.get(global-vars.$border-width--thin); + block-size: props.get(core.$border-width--thin); margin: 0; - background-color: props.get(global-vars.$theme, --border-color); + background-color: props.get(core.$theme, --border-color); border: 0; } } diff --git a/src/scopes/_implicit.vars.scss b/src/scopes/_implicit.vars.scss index c18ca78..036ace3 100644 --- a/src/scopes/_implicit.vars.scss +++ b/src/scopes/_implicit.vars.scss @@ -1,7 +1,7 @@ @use '../props'; -@use '../vars'; +@use '../core'; -$paragraph--margin-bs: props.def(--s-implicit--paragraph--margin-bs, props.get(vars.$size--300)) !default; +$paragraph--margin-bs: props.def(--s-implicit--paragraph--margin-bs, props.get(core.$size--300)) !default; -$heading--margin-bs: props.def(--s-implicit--heading--margin-bs, props.get(vars.$size--700)) !default; -$heading--margin-bs-sibling: props.def(--s-implicit--heading--margin-bs-sibling, props.get(vars.$size--325)) !default; +$heading--margin-bs: props.def(--s-implicit--heading--margin-bs, props.get(core.$size--700)) !default; +$heading--margin-bs-sibling: props.def(--s-implicit--heading--margin-bs-sibling, props.get(core.$size--325)) !default; diff --git a/src/scopes/_links.vars.scss b/src/scopes/_links.vars.scss index 7880204..b40cae8 100644 --- a/src/scopes/_links.vars.scss +++ b/src/scopes/_links.vars.scss @@ -1,46 +1,46 @@ @use 'sass:map'; @use '../props'; -@use '../vars'; +@use '../core'; -$rounding: props.def(--s-links--rounding, props.get(vars.$rounding)) !default; -$underline-width: props.def(--s-links--underline-width, props.get(vars.$border-width--thin)) !default; -$hover--underline-width: props.def(--s-links--hover--underline-width, props.get(vars.$border-width--medium)) !default; +$rounding: props.def(--s-links--rounding, props.get(core.$rounding)) !default; +$underline-width: props.def(--s-links--underline-width, props.get(core.$border-width--thin)) !default; +$hover--underline-width: props.def(--s-links--hover--underline-width, props.get(core.$border-width--medium)) !default; -$key-focus--border-width: props.def(--s-links--key-focus--border-width, props.get(vars.$key-focus--border-width)) !default; -$key-focus--border-offset: props.def(--s-links--key-focus--border-offset, props.get(vars.$key-focus--border-offset)) !default; -$key-focus--outline-width: props.def(--s-links--key-focus--outline-width, props.get(vars.$key-focus--outline-width)) !default; +$key-focus--border-width: props.def(--s-links--key-focus--border-width, props.get(core.$key-focus--border-width)) !default; +$key-focus--border-offset: props.def(--s-links--key-focus--border-offset, props.get(core.$key-focus--border-offset)) !default; +$key-focus--outline-width: props.def(--s-links--key-focus--outline-width, props.get(core.$key-focus--outline-width)) !default; -$underline-color: props.def(--s-links--underline-color, props.get(vars.$theme, --text-mute-more)) !default; +$underline-color: props.def(--s-links--underline-color, props.get(core.$theme, --text-mute-more)) !default; -$colored--text-color: props.def(--s-links--colored--text-color, props.get(vars.$theme, --accent, --1100)) !default; -$colored--underline-color: props.def(--s-links--colored--underline-color, props.get(vars.$theme, --accent, --600)) !default; -$colored--hover--text-color: props.def(--s-links--colored--hover--text-color, props.get(vars.$theme, --accent, --1300)) !default; +$colored--text-color: props.def(--s-links--colored--text-color, props.get(core.$theme, --accent, --1100)) !default; +$colored--underline-color: props.def(--s-links--colored--underline-color, props.get(core.$theme, --accent, --600)) !default; +$colored--hover--text-color: props.def(--s-links--colored--hover--text-color, props.get(core.$theme, --accent, --1300)) !default; -$colored--visited--text-color: props.def(--s-links--colored--visited--text-color, props.get(vars.$theme, --purple, --1100)) !default; -$colored--visited--underline-color: props.def(--s-links--colored--visited--underline-color, props.get(vars.$theme, --purple, --600)) !default; -$colored--visited--hover--text-color: props.def(--s-links--colored--visited--hover--text-color, props.get(vars.$theme, --purple, --1300)) !default; +$colored--visited--text-color: props.def(--s-links--colored--visited--text-color, props.get(core.$theme, --purple, --1100)) !default; +$colored--visited--underline-color: props.def(--s-links--colored--visited--underline-color, props.get(core.$theme, --purple, --600)) !default; +$colored--visited--hover--text-color: props.def(--s-links--colored--visited--hover--text-color, props.get(core.$theme, --purple, --1300)) !default; -$key-focus--text-color: props.def(--s-links--key-focus--text-color, props.get(vars.$theme, --focus, --text)) !default; -$key-focus--border-color: props.def(--s-links--key-focus--border-color, props.get(vars.$theme, --focus, --border)) !default; -$key-focus--outline-color: props.def(--s-links--key-focus--outline-color, props.get(vars.$theme, --focus, --outline)) !default; +$key-focus--text-color: props.def(--s-links--key-focus--text-color, props.get(core.$theme, --focus, --text)) !default; +$key-focus--border-color: props.def(--s-links--key-focus--border-color, props.get(core.$theme, --focus, --border)) !default; +$key-focus--outline-color: props.def(--s-links--key-focus--outline-color, props.get(core.$theme, --focus, --outline)) !default; $static-themes: props.def(--s-links); -@each $theme in map.keys(props.get(vars.$transparent-colors)) { +@each $theme in map.keys(props.get(core.$transparent-colors)) { $link-theme: #{$theme}-static; $static-themes: props.merge($static-themes, ( $link-theme: ( - --text-color: props.get(vars.$transparent-colors, $theme, --800), - --underline-color: props.get(vars.$transparent-colors, $theme, --500), + --text-color: props.get(core.$transparent-colors, $theme, --800), + --underline-color: props.get(core.$transparent-colors, $theme, --500), --hover: ( - --text-color: props.get(vars.$transparent-colors, $theme, --900), + --text-color: props.get(core.$transparent-colors, $theme, --900), ), --key-focus: ( - --text-color: props.get(vars.$transparent-colors, $theme, --900), - --border-color: props.get(vars.$transparent-colors, $theme, --900), - --outline-color: props.get(vars.$transparent-colors, $theme, --300), + --text-color: props.get(core.$transparent-colors, $theme, --900), + --border-color: props.get(core.$transparent-colors, $theme, --900), + --outline-color: props.get(core.$transparent-colors, $theme, --300), ), ) )); diff --git a/src/scopes/_lists.scss b/src/scopes/_lists.scss index db555a9..d5421ca 100644 --- a/src/scopes/_lists.scss +++ b/src/scopes/_lists.scss @@ -1,7 +1,7 @@ @use 'sass:meta'; @use 'iro-sass/src/iro-sass' as iro; @use '../props'; -@use '../vars' as global-vars; +@use '../core'; @forward 'lists.vars'; @use 'lists.vars' as vars; @@ -37,7 +37,7 @@ dt { font-weight: bold; - color: props.get(global-vars.$theme, --heading); + color: props.get(core.$theme, --heading); } dd { diff --git a/src/scopes/_lists.vars.scss b/src/scopes/_lists.vars.scss index 609cfb5..6dd04ac 100644 --- a/src/scopes/_lists.vars.scss +++ b/src/scopes/_lists.vars.scss @@ -1,8 +1,8 @@ @use '../props'; -@use '../vars'; -@use './implicit.vars' as implicit-vars; +@use '../core'; +@use './implicit' as implicit; -$indent: props.def(--s-lists--indent, calc(props.get(vars.$list--indent) + 1em)) !default; -$margin-bs: props.def(--s-lists--margin-bs, props.get(implicit-vars.$paragraph--margin-bs)) !default; +$indent: props.def(--s-lists--indent, calc(props.get(core.$list--indent) + 1em)) !default; +$margin-bs: props.def(--s-lists--margin-bs, props.get(implicit.$paragraph--margin-bs)) !default; -$compact--indent: props.def(--s-lists--compact--indent, props.get(vars.$list--compact-indent)) !default; +$compact--indent: props.def(--s-lists--compact--indent, props.get(core.$list--compact-indent)) !default; diff --git a/src/scopes/_tables.vars.scss b/src/scopes/_tables.vars.scss index 2c3f255..2d7fed1 100644 --- a/src/scopes/_tables.vars.scss +++ b/src/scopes/_tables.vars.scss @@ -1,10 +1,10 @@ @use '../props'; -@use '../vars'; +@use '../core'; -$indent: props.def(--s-lists--indent, calc(props.get(vars.$list--indent) + 1em)) !default; -$margin-bs: props.def(--s-lists--margin-bs, props.get(vars.$paragraph--margin-bs)) !default; +$indent: props.def(--s-lists--indent, calc(props.get(core.$list--indent) + 1em)) !default; +$margin-bs: props.def(--s-lists--margin-bs, props.get(core.$paragraph--margin-bs)) !default; -$compact--indent: props.def(--s-lists--compact--indent, props.get(vars.$list--compact-indent)) !default; +$compact--indent: props.def(--s-lists--compact--indent, props.get(core.$list--compact-indent)) !default; @include iro.props-store(( --dims: ( diff --git a/src_demo/index.scss b/src_demo/index.scss index 59f9466..0189928 100644 --- a/src_demo/index.scss +++ b/src_demo/index.scss @@ -1,6 +1,6 @@ @use '../src/iro-design' as iro; -@include iro.vars--vars; +@include iro.core--styles; @include iro.s-implicit--styles; @include iro.s-blockquotes--styles; @@ -17,3 +17,5 @@ @include iro.l-overflow--styles; @include iro.o-action-button--styles; +@include iro.o-alert--styles; +@include iro.o-avatar--styles; -- cgit v1.2.3-70-g09d2