From 20283a9690e468d92aa74bab08c8bc16de5d2d96 Mon Sep 17 00:00:00 2001 From: gracetxgao <101677420+gracetxgao@users.noreply.github.com> Date: Mon, 9 Dec 2024 10:45:33 -0800 Subject: [PATCH 1/9] test(design): add test for map-get --- .../design/scss/core/map/map-get/map-get.scss | 22 ++++++++++++++++ .../scss/core/map/map-get/map-get.spec.scss | 25 +++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 libs/design/scss/core/map/map-get/map-get.scss create mode 100644 libs/design/scss/core/map/map-get/map-get.spec.scss diff --git a/libs/design/scss/core/map/map-get/map-get.scss b/libs/design/scss/core/map/map-get/map-get.scss new file mode 100644 index 0000000000..8c5c88b08c --- /dev/null +++ b/libs/design/scss/core/map/map-get/map-get.scss @@ -0,0 +1,22 @@ +@use 'sass:map'; + +// +// Return a the value of a nested key in a map if it exists. +// If the key doesn't exist, it throw an error. +// +// Note: This function doesn't support the use +// of the search character in your map key names. +// +// @usage daff-map-get($map, nested, map, key); +// @returns any +// @throws error +@function daff-map-get($map, $keys...) { + @each $key in $keys { + @if not map.has-key($map, $keys) { + @error 'The map doesn\'t contain the $key: `#{$key}`\''; + } + $map: map.get($map, $key); + } + + @return $map; +} diff --git a/libs/design/scss/core/map/map-get/map-get.spec.scss b/libs/design/scss/core/map/map-get/map-get.spec.scss new file mode 100644 index 0000000000..ec9600d958 --- /dev/null +++ b/libs/design/scss/core/map/map-get/map-get.spec.scss @@ -0,0 +1,25 @@ +@use 'true' as *; +@use './map-get' as *; + +@include describe('map-get') { + $nested-map: ( + 'string': '3', + 'number': 4 + ); + + $map: ( + 'nested': ( + 'string': '1', + 'number': 2, + 'map': $nested-map + ) + ); + + @include it('returns the value of the nested key if it exists in the map') { + @include assert-equal(daff-map-get($map, nested, string), '1'); + @include assert-equal(daff-map-get($map, nested, number), 2); + @include assert-equal(daff-map-get($map, nested, map), $nested-map); + @include assert-equal(daff-map-get($map, nested, map, string), '3'); + @include assert-equal(daff-map-get($map, nested, map, number), 4); + } +} From 8928ee1729adb28015d2b3ec0d4f84874dbc79cc Mon Sep 17 00:00:00 2001 From: gracetxgao <101677420+gracetxgao@users.noreply.github.com> Date: Tue, 10 Dec 2024 13:03:50 -0800 Subject: [PATCH 2/9] test(design): edit daff-map-get tests --- libs/design/scss/core/map/map-get/map-get.scss | 2 +- libs/design/scss/core/map/map-get/map-get.spec.scss | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/libs/design/scss/core/map/map-get/map-get.scss b/libs/design/scss/core/map/map-get/map-get.scss index 8c5c88b08c..136cd971fd 100644 --- a/libs/design/scss/core/map/map-get/map-get.scss +++ b/libs/design/scss/core/map/map-get/map-get.scss @@ -12,7 +12,7 @@ // @throws error @function daff-map-get($map, $keys...) { @each $key in $keys { - @if not map.has-key($map, $keys) { + @if not map.has-key($map, $key) { @error 'The map doesn\'t contain the $key: `#{$key}`\''; } $map: map.get($map, $key); diff --git a/libs/design/scss/core/map/map-get/map-get.spec.scss b/libs/design/scss/core/map/map-get/map-get.spec.scss index ec9600d958..3cc640b6f5 100644 --- a/libs/design/scss/core/map/map-get/map-get.spec.scss +++ b/libs/design/scss/core/map/map-get/map-get.spec.scss @@ -16,10 +16,10 @@ ); @include it('returns the value of the nested key if it exists in the map') { - @include assert-equal(daff-map-get($map, nested, string), '1'); - @include assert-equal(daff-map-get($map, nested, number), 2); - @include assert-equal(daff-map-get($map, nested, map), $nested-map); - @include assert-equal(daff-map-get($map, nested, map, string), '3'); - @include assert-equal(daff-map-get($map, nested, map, number), 4); + @include assert-equal(daff-map-get($map, 'nested', 'string'), '1'); + @include assert-equal(daff-map-get($map, 'nested', 'number'), 2); + @include assert-equal(daff-map-get($map, 'nested', 'map'), $nested-map); + @include assert-equal(daff-map-get($map, 'nested', 'map', 'string'), '3'); + @include assert-equal(daff-map-get($map, 'nested', 'map', 'number'), 4); } } From bf4aadb64b61468ef1fb91e641afc4f4797ab5eb Mon Sep 17 00:00:00 2001 From: gracetxgao <101677420+gracetxgao@users.noreply.github.com> Date: Tue, 10 Dec 2024 22:02:26 -0800 Subject: [PATCH 3/9] test(design): add tests for daff-map-get errors --- .../scss/core/map/map-get/map-get-error.scss | 13 +++++++ .../design/scss/core/map/map-get/map-get.scss | 3 +- .../scss/core/map/map-get/map-get.spec.scss | 35 +++++++++++++++++++ 3 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 libs/design/scss/core/map/map-get/map-get-error.scss diff --git a/libs/design/scss/core/map/map-get/map-get-error.scss b/libs/design/scss/core/map/map-get/map-get-error.scss new file mode 100644 index 0000000000..d9925d5fa4 --- /dev/null +++ b/libs/design/scss/core/map/map-get/map-get-error.scss @@ -0,0 +1,13 @@ +$debug: false !default; + +@function map-get-error($message, $override: $debug) { + @if $override { + @return $message; + } @else { + @error $message; + } +} + +@mixin set-debug($state: true) { + $debug: $state !global; +} \ No newline at end of file diff --git a/libs/design/scss/core/map/map-get/map-get.scss b/libs/design/scss/core/map/map-get/map-get.scss index 136cd971fd..2eab9c807a 100644 --- a/libs/design/scss/core/map/map-get/map-get.scss +++ b/libs/design/scss/core/map/map-get/map-get.scss @@ -1,4 +1,5 @@ @use 'sass:map'; +@use './map-get-error'; // // Return a the value of a nested key in a map if it exists. @@ -13,7 +14,7 @@ @function daff-map-get($map, $keys...) { @each $key in $keys { @if not map.has-key($map, $key) { - @error 'The map doesn\'t contain the $key: `#{$key}`\''; + @return map-get-error.map-get-error("The map doesn't contain the $key: `#{$key}`'"); } $map: map.get($map, $key); } diff --git a/libs/design/scss/core/map/map-get/map-get.spec.scss b/libs/design/scss/core/map/map-get/map-get.spec.scss index 3cc640b6f5..484a1f5b50 100644 --- a/libs/design/scss/core/map/map-get/map-get.spec.scss +++ b/libs/design/scss/core/map/map-get/map-get.spec.scss @@ -1,5 +1,6 @@ @use 'true' as *; @use './map-get' as *; +@use './map-get-error'; @include describe('map-get') { $nested-map: ( @@ -15,6 +16,20 @@ ) ); + $deep-map: ( + 'level1': ( + 'level2': ( + 'level3': ( + 'level': 4 + ) + ) + ) + ); + + $empty-map: (); + + @include map-get-error.set-debug(true); + @include it('returns the value of the nested key if it exists in the map') { @include assert-equal(daff-map-get($map, 'nested', 'string'), '1'); @include assert-equal(daff-map-get($map, 'nested', 'number'), 2); @@ -22,4 +37,24 @@ @include assert-equal(daff-map-get($map, 'nested', 'map', 'string'), '3'); @include assert-equal(daff-map-get($map, 'nested', 'map', 'number'), 4); } + + @include it('returns the correct value for deeply nested maps') { + @include assert-equal(daff-map-get($deep-map, 'level1', 'level2', 'level3', 'level'), 4); + } + + @include it('errors if the value of the nested key does not exist in the map') { + @include assert-equal( + daff-map-get($map, 'missing'), + "The map doesn't contain the $key: `missing`'" + ); + } + + @include it('errors if the map is empty') { + @include assert-equal( + daff-map-get($empty-map, 'nested'), + "The map doesn't contain the $key: `nested`'" + ); + } + + @include map-get-error.set-debug(false); } From 626255c6abdfb23b5b9cb5a8b8f12930159fd39d Mon Sep 17 00:00:00 2001 From: gracetxgao <101677420+gracetxgao@users.noreply.github.com> Date: Wed, 11 Dec 2024 11:11:08 -0800 Subject: [PATCH 4/9] forward map-get in _index.scss --- libs/design/scss/core/_index.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/libs/design/scss/core/_index.scss b/libs/design/scss/core/_index.scss index b3fb73fe5d..faae793e7c 100644 --- a/libs/design/scss/core/_index.scss +++ b/libs/design/scss/core/_index.scss @@ -2,3 +2,4 @@ @forward 'map/map-deep-check/map-deep-check'; @forward 'map/map-deep-get/map-deep-get'; +@forward 'map/map-get/map-get'; From a23222b8ffc6f604cf6ec05ea4d2827b7b44c767 Mon Sep 17 00:00:00 2001 From: gracetxgao <101677420+gracetxgao@users.noreply.github.com> Date: Fri, 13 Dec 2024 12:41:30 -0800 Subject: [PATCH 5/9] feat(design): replace daff-map-deep-get with daff-map-get --- .../feature-comparison-theme.scss | 4 +- .../app/core/footer/footer/footer-theme.scss | 6 +- .../simple-footer/simple-footer-theme.scss | 6 +- .../sidebar-footer/sidebar-footer-theme.scss | 6 +- .../device/iphone/iphone.component.scss | 2 +- .../api-list-section-theme.scss | 6 +- .../components/api-list/api-list-theme.scss | 6 +- .../api-package/api-package-theme.scss | 6 +- .../table-of-contents-theme.scss | 6 +- .../src/app/newsletter/newsletter-theme.scss | 6 +- .../src/scss/type-descriptors/_mixins.scss | 8 ++- apps/demo/src/scss/demo-theme.scss | 6 +- .../component/code-preview-theme.scss | 9 ++- .../sidebar-viewport-theme.scss | 8 +-- .../app/foundations/color/color-theme.scss | 10 ++-- .../src/app/typography/typography-theme.scss | 8 +-- libs/branding/src/lib/logo/logo-theme.scss | 6 +- libs/branding/src/scss/branding-theme.scss | 4 +- .../design/accordion/src/accordion-theme.scss | 4 +- libs/design/article/src/article-theme.scss | 10 ++-- .../breadcrumb/src/breadcrumb-theme.scss | 6 +- .../button/src/button/basic/button-theme.scss | 10 ++-- .../button/src/button/flat/flat-theme.scss | 19 +++---- .../button/src/button/icon/icon-theme.scss | 13 ++--- .../src/button/raised/raised-theme.scss | 56 ++++++++----------- .../src/button/stroked/stroked-theme.scss | 15 ++--- .../src/button/underline/underline-theme.scss | 18 +++--- libs/design/callout/src/callout-theme.scss | 22 +++----- libs/design/card/src/card-theme.scss | 10 ++-- libs/design/hero/src/hero-theme.scss | 22 +++----- libs/design/list/src/list-theme.scss | 12 ++-- .../loading-icon/src/loading-icon-theme.scss | 8 +-- .../src/media-gallery-theme.scss | 2 +- libs/design/menu/src/menu-theme.scss | 10 ++-- libs/design/modal/src/modal-theme.scss | 2 +- libs/design/navbar/src/navbar-theme.scss | 10 ++-- .../notification/src/notification-theme.scss | 10 ++-- .../design/paginator/src/paginator-theme.scss | 12 ++-- .../progress-bar/src/progress-bar-theme.scss | 10 ++-- libs/design/scss/core/_index.scss | 2 - .../map-deep-check/map-deep-check.spec.scss | 43 -------------- .../map/map-deep-get/map-deep-get.spec.scss | 25 --------- .../scss/core/map/map-get/map-get.spec.scss | 41 ++++++++------ libs/design/scss/state/skeleton/_mixins.scss | 4 +- libs/design/scss/theming/_daff-theme.scss | 4 +- .../scss/theming/_theme-css-variables.scss | 10 ++-- libs/design/sidebar/src/sidebar-theme.scss | 6 +- .../form-field/form-field-theme.scss | 6 +- .../src/atoms/form/input/input-theme.scss | 4 +- .../native-select/native-select-theme.scss | 6 +- libs/design/tabs/src/tabs-theme.scss | 10 ++-- libs/design/toast/src/toast-theme.scss | 12 ++-- libs/design/tree/src/tree-theme.scss | 10 ++-- 53 files changed, 242 insertions(+), 335 deletions(-) delete mode 100644 libs/design/scss/core/map/map-deep-check/map-deep-check.spec.scss delete mode 100644 libs/design/scss/core/map/map-deep-get/map-deep-get.spec.scss diff --git a/apps/daffio/src/app/content/why-pwa/components/feature-comparison/feature-comparison-theme.scss b/apps/daffio/src/app/content/why-pwa/components/feature-comparison/feature-comparison-theme.scss index 43c2bf9430..711d3c6bc1 100644 --- a/apps/daffio/src/app/content/why-pwa/components/feature-comparison/feature-comparison-theme.scss +++ b/apps/daffio/src/app/content/why-pwa/components/feature-comparison/feature-comparison-theme.scss @@ -3,8 +3,8 @@ @mixin daffio-feature-comparison-theme($theme) { $secondary: map.get($theme, secondary); - $base: daff-theme.daff-map-deep-get($theme, 'core.base'); - $base-contrast: daff-theme.daff-map-deep-get($theme, 'core.base-contrast'); + $base: daff-theme.daff-map-get($theme, 'core', 'base'); + $base-contrast: daff-theme.daff-map-get($theme, 'core', 'base-contrast'); .daffio-feature-comparison { background: $base; diff --git a/apps/daffio/src/app/core/footer/footer/footer-theme.scss b/apps/daffio/src/app/core/footer/footer/footer-theme.scss index 1a2a92ea20..eefdbae3e0 100644 --- a/apps/daffio/src/app/core/footer/footer/footer-theme.scss +++ b/apps/daffio/src/app/core/footer/footer/footer-theme.scss @@ -2,9 +2,9 @@ @use 'sass:map'; @mixin daffio-footer-theme($theme) { - $neutral: daff-theme.daff-map-deep-get($theme, 'core.neutral'); - $base: daff-theme.daff-map-deep-get($theme, 'core.base'); - $base-contrast: daff-theme.daff-map-deep-get($theme, 'core.base-contrast'); + $neutral: daff-theme.daff-map-get($theme, 'core', 'neutral'); + $base: daff-theme.daff-map-get($theme, 'core', 'base'); + $base-contrast: daff-theme.daff-map-get($theme, 'core', 'base-contrast'); $secondary: map.get($theme, secondary); .daffio-footer { diff --git a/apps/daffio/src/app/core/footer/simple-footer/simple-footer-theme.scss b/apps/daffio/src/app/core/footer/simple-footer/simple-footer-theme.scss index 0f2aad6e03..e5cacc8e53 100644 --- a/apps/daffio/src/app/core/footer/simple-footer/simple-footer-theme.scss +++ b/apps/daffio/src/app/core/footer/simple-footer/simple-footer-theme.scss @@ -1,9 +1,9 @@ @use 'theme' as daff-theme; @mixin daffio-simple-footer-theme($theme) { - $neutral: daff-theme.daff-map-deep-get($theme, 'core.neutral'); - $base: daff-theme.daff-map-deep-get($theme, 'core.base'); - $base-contrast: daff-theme.daff-map-deep-get($theme, 'core.base-contrast'); + $neutral: daff-theme.daff-map-get($theme, 'core', 'neutral'); + $base: daff-theme.daff-map-get($theme, 'core', 'base'); + $base-contrast: daff-theme.daff-map-get($theme, 'core', 'base-contrast'); .daffio-simple-footer { border-top: 1px solid daff-theme.daff-illuminate($base, $neutral, 2); diff --git a/apps/daffio/src/app/core/sidebar/components/sidebar-footer/sidebar-footer-theme.scss b/apps/daffio/src/app/core/sidebar/components/sidebar-footer/sidebar-footer-theme.scss index 53eeb93da6..04330c1548 100644 --- a/apps/daffio/src/app/core/sidebar/components/sidebar-footer/sidebar-footer-theme.scss +++ b/apps/daffio/src/app/core/sidebar/components/sidebar-footer/sidebar-footer-theme.scss @@ -2,9 +2,9 @@ @use 'theme' as daff-theme; @mixin daffio-sidebar-footer-theme($theme) { - $neutral: daff-theme.daff-map-deep-get($theme, 'core.neutral'); - $base: daff-theme.daff-map-deep-get($theme, 'core.base'); - $base-contrast: daff-theme.daff-map-deep-get($theme, 'core.base-contrast'); + $neutral: daff-theme.daff-map-get($theme, 'core', 'neutral'); + $base: daff-theme.daff-map-get($theme, 'core', 'base'); + $base-contrast: daff-theme.daff-map-get($theme, 'core', 'base-contrast'); $primary: map.get($theme, primary); .daffio-sidebar-footer { diff --git a/apps/daffio/src/app/design/device/iphone/iphone.component.scss b/apps/daffio/src/app/design/device/iphone/iphone.component.scss index b23b6386f6..a08ef53b14 100644 --- a/apps/daffio/src/app/design/device/iphone/iphone.component.scss +++ b/apps/daffio/src/app/design/device/iphone/iphone.component.scss @@ -1,7 +1,7 @@ // @import 'theme'; // @use 'utilities' as *; -// $phoneColor: daff-map-deep-get($theme, 'core.base'); +// $phoneColor: daff-map-get($theme, "core", "base"); // $phoneShadow: daff-illuminate($phoneColor, $daff-neutral, 3); // .iphone { diff --git a/apps/daffio/src/app/docs/api/components/api-list-section/api-list-section-theme.scss b/apps/daffio/src/app/docs/api/components/api-list-section/api-list-section-theme.scss index d7d957173b..01bafb344b 100644 --- a/apps/daffio/src/app/docs/api/components/api-list-section/api-list-section-theme.scss +++ b/apps/daffio/src/app/docs/api/components/api-list-section/api-list-section-theme.scss @@ -1,9 +1,9 @@ @use 'theme' as daff-theme; @mixin daffio-api-list-section-theme($theme) { - $neutral: daff-theme.daff-map-deep-get($theme, 'core.neutral'); - $base: daff-theme.daff-map-deep-get($theme, 'core.base'); - $base-contrast: daff-theme.daff-map-deep-get($theme, 'core.base-contrast'); + $neutral: daff-theme.daff-map-get($theme, 'core', 'neutral'); + $base: daff-theme.daff-map-get($theme, 'core', 'base'); + $base-contrast: daff-theme.daff-map-get($theme, 'core', 'base-contrast'); .daffio-api-list-section { &__item { diff --git a/apps/daffio/src/app/docs/api/components/api-list/api-list-theme.scss b/apps/daffio/src/app/docs/api/components/api-list/api-list-theme.scss index 7bf84e6fa9..02980566a0 100644 --- a/apps/daffio/src/app/docs/api/components/api-list/api-list-theme.scss +++ b/apps/daffio/src/app/docs/api/components/api-list/api-list-theme.scss @@ -1,9 +1,9 @@ @use 'theme' as daff-theme; @mixin daffio-api-list-theme($theme) { - $neutral: daff-theme.daff-map-deep-get($theme, 'core.neutral'); - $base: daff-theme.daff-map-deep-get($theme, 'core.base'); - $base-contrast: daff-theme.daff-map-deep-get($theme, 'core.base-contrast'); + $neutral: daff-theme.daff-map-get($theme, 'core', 'neutral'); + $base: daff-theme.daff-map-get($theme, 'core', 'base'); + $base-contrast: daff-theme.daff-map-get($theme, 'core', 'base-contrast'); .daffio-api-list { &__package-name { diff --git a/apps/daffio/src/app/docs/api/components/api-package/api-package-theme.scss b/apps/daffio/src/app/docs/api/components/api-package/api-package-theme.scss index c2831971a3..f6a2c27823 100644 --- a/apps/daffio/src/app/docs/api/components/api-package/api-package-theme.scss +++ b/apps/daffio/src/app/docs/api/components/api-package/api-package-theme.scss @@ -1,9 +1,9 @@ @use 'theme' as daff-theme; @mixin daffio-api-package-theme($theme) { - $neutral: daff-theme.daff-map-deep-get($theme, 'core.neutral'); - $base: daff-theme.daff-map-deep-get($theme, 'core.base'); - $base-contrast: daff-theme.daff-map-deep-get($theme, 'core.base-contrast'); + $neutral: daff-theme.daff-map-get($theme, 'core', 'neutral'); + $base: daff-theme.daff-map-get($theme, 'core', 'base'); + $base-contrast: daff-theme.daff-map-get($theme, 'core', 'base-contrast'); .daffio-api-package { &__subpackage-name { diff --git a/apps/daffio/src/app/docs/components/table-of-contents/table-of-contents-theme.scss b/apps/daffio/src/app/docs/components/table-of-contents/table-of-contents-theme.scss index 3a00471272..36607893a3 100644 --- a/apps/daffio/src/app/docs/components/table-of-contents/table-of-contents-theme.scss +++ b/apps/daffio/src/app/docs/components/table-of-contents/table-of-contents-theme.scss @@ -1,9 +1,9 @@ @use 'theme' as daff-theme; @mixin daffio-table-of-contents-theme($theme) { - $neutral: daff-theme.daff-map-deep-get($theme, 'core.neutral'); - $base: daff-theme.daff-map-deep-get($theme, 'core.base'); - $base-contrast: daff-theme.daff-map-deep-get($theme, 'core.base-contrast'); + $neutral: daff-theme.daff-map-get($theme, 'core', 'neutral'); + $base: daff-theme.daff-map-get($theme, 'core', 'base'); + $base-contrast: daff-theme.daff-map-get($theme, 'core', 'base-contrast'); .daffio-table-of-contents { &__item { diff --git a/apps/daffio/src/app/newsletter/newsletter-theme.scss b/apps/daffio/src/app/newsletter/newsletter-theme.scss index 4cb0cbae1c..e23dc7fa85 100644 --- a/apps/daffio/src/app/newsletter/newsletter-theme.scss +++ b/apps/daffio/src/app/newsletter/newsletter-theme.scss @@ -1,9 +1,9 @@ @use 'theme' as daff-theme; @mixin daffio-newsletter-theme($theme) { - $neutral: daff-theme.daff-map-deep-get($theme, 'core.neutral'); - $base: daff-theme.daff-map-deep-get($theme, 'core.base'); - $base-contrast: daff-theme.daff-map-deep-get($theme, 'core.base-contrast'); + $neutral: daff-theme.daff-map-get($theme, 'core', 'neutral'); + $base: daff-theme.daff-map-get($theme, 'core', 'base'); + $base-contrast: daff-theme.daff-map-get($theme, 'core', 'base-contrast'); .daffio-newsletter { &__input { diff --git a/apps/daffio/src/scss/type-descriptors/_mixins.scss b/apps/daffio/src/scss/type-descriptors/_mixins.scss index 9500137f12..4305c73122 100644 --- a/apps/daffio/src/scss/type-descriptors/_mixins.scss +++ b/apps/daffio/src/scss/type-descriptors/_mixins.scss @@ -6,8 +6,12 @@ $primary: map.get(daff-theme.$theme, primary); $secondary: map.get(daff-theme.$theme, secondary); $tertiary: map.get(daff-theme.$theme, tertiary); -$base: daff-theme.daff-map-deep-get(daff-theme.$theme, 'core.base'); -$base-contrast: daff-theme.daff-map-deep-get(daff-theme.$theme, 'core.base-contrast'); +$base: daff-theme.daff-map-get(daff-theme.$theme, 'core', 'base'); +$base-contrast: daff-theme.daff-map-get( + daff-theme.$theme, + 'core', + 'base-contrast' +); @mixin type-theming($color) { background: $color; diff --git a/apps/demo/src/scss/demo-theme.scss b/apps/demo/src/scss/demo-theme.scss index 02b5472ec5..0e6296e9b4 100644 --- a/apps/demo/src/scss/demo-theme.scss +++ b/apps/demo/src/scss/demo-theme.scss @@ -7,6 +7,6 @@ $tertiary: daff-theme.daff-configure-palette(daff-theme.$daff-turquoise, 60); $theme: daff-theme.daff-configure-theme($primary, $secondary, $tertiary, 'light'); -$black: daff-theme.daff-map-deep-get($theme, 'core.black'); -$white: daff-theme.daff-map-deep-get($theme, 'core.white'); -$neutral: daff-theme.daff-map-deep-get($theme, 'core.neutral'); +$black: daff-theme.daff-map-get($theme, 'core', 'black'); +$white: daff-theme.daff-map-get($theme, 'core', 'white'); +$neutral: daff-theme.daff-map-get($theme, 'core', 'neutral'); diff --git a/apps/design-land/src/app/core/code-preview/component/code-preview-theme.scss b/apps/design-land/src/app/core/code-preview/component/code-preview-theme.scss index b7bc1874df..82a7274c7a 100644 --- a/apps/design-land/src/app/core/code-preview/component/code-preview-theme.scss +++ b/apps/design-land/src/app/core/code-preview/component/code-preview-theme.scss @@ -1,12 +1,11 @@ @use 'sass:map'; @use 'theme' as daff-theme; - @mixin code-preview-theme($theme) { - $neutral: daff-theme.daff-map-deep-get($theme, 'core.neutral'); - $base: daff-theme.daff-map-deep-get($theme, 'core.base'); + $neutral: daff-theme.daff-map-get($theme, 'core', 'neutral'); + $base: daff-theme.daff-map-get($theme, 'core', 'base'); $primary: map.get(daff-theme.$theme, primary); - $font-color: daff-theme.daff-map-deep-get($theme, 'core.font-color'); + $font-color: daff-theme.daff-map-get($theme, 'core', 'font-color'); $border: 1px solid daff-theme.daff-illuminate($base, $neutral, 2); .design-land-code-preview { @@ -28,4 +27,4 @@ } } } -} \ No newline at end of file +} diff --git a/apps/design-land/src/app/core/sidebar-viewport/sidebar-viewport-theme.scss b/apps/design-land/src/app/core/sidebar-viewport/sidebar-viewport-theme.scss index 41b4d37730..6b4d025943 100644 --- a/apps/design-land/src/app/core/sidebar-viewport/sidebar-viewport-theme.scss +++ b/apps/design-land/src/app/core/sidebar-viewport/sidebar-viewport-theme.scss @@ -2,9 +2,9 @@ @use 'theme' as daff-theme; @mixin sidebar-viewport-theme($theme) { - $neutral: daff-theme.daff-map-deep-get($theme, 'core.neutral'); - $base: daff-theme.daff-map-deep-get($theme, 'core.base'); - $base-contrast: daff-theme.daff-map-deep-get($theme, 'core.base-contrast'); + $neutral: daff-theme.daff-map-get($theme, 'core', 'neutral'); + $base: daff-theme.daff-map-get($theme, 'core', 'base'); + $base-contrast: daff-theme.daff-map-get($theme, 'core', 'base-contrast'); $primary: map.get($theme, primary); .design-land-sidebar-viewport { @@ -25,4 +25,4 @@ color: $base; } } -} \ No newline at end of file +} diff --git a/apps/design-land/src/app/foundations/color/color-theme.scss b/apps/design-land/src/app/foundations/color/color-theme.scss index 9bbf04109b..8710f8428b 100644 --- a/apps/design-land/src/app/foundations/color/color-theme.scss +++ b/apps/design-land/src/app/foundations/color/color-theme.scss @@ -1,21 +1,21 @@ @use 'theme' as daff-theme; @mixin color-theme($theme) { - $white: daff-theme.daff-map-deep-get($theme, 'core.white'); - $black: daff-theme.daff-map-deep-get($theme, 'core.black'); + $white: daff-theme.daff-map-get($theme, 'core', 'white'); + $black: daff-theme.daff-map-get($theme, 'core', 'black'); .dl-color { &__palette { > * { - &:nth-child(n+6) { + &:nth-child(n + 6) { color: daff-theme.$white; } } - + &.brand-yellow { > * { color: daff-theme.$black; - + &:last-child { color: daff-theme.$white; } diff --git a/apps/design-land/src/app/typography/typography-theme.scss b/apps/design-land/src/app/typography/typography-theme.scss index 6de824f9e0..74562c6c3c 100644 --- a/apps/design-land/src/app/typography/typography-theme.scss +++ b/apps/design-land/src/app/typography/typography-theme.scss @@ -2,16 +2,16 @@ @use 'theme' as daff-theme; @mixin typography-theme($theme) { - $neutral: daff-theme.daff-map-deep-get($theme, 'core.neutral'); + $neutral: daff-theme.daff-map-get($theme, 'core', 'neutral'); .dl-typography { &__typescale-card { border: 1px solid daff-theme.daff-color($neutral, 20); } - + &__desktop-subheading, &__mobile-subheading { color: daff-theme.daff-color($neutral); } - } -} \ No newline at end of file + } +} diff --git a/libs/branding/src/lib/logo/logo-theme.scss b/libs/branding/src/lib/logo/logo-theme.scss index 790a32cb21..29a9682b85 100644 --- a/libs/branding/src/lib/logo/logo-theme.scss +++ b/libs/branding/src/lib/logo/logo-theme.scss @@ -2,9 +2,9 @@ @use 'theme' as daff-theme; @mixin daff-logo-theme($theme) { - $neutral: daff-theme.daff-map-deep-get($theme, 'core.neutral'); - $base: branding-theme.daff-map-deep-get($theme, 'core.base'); - $base-contrast: branding-theme.daff-map-deep-get($theme, 'core.base-contrast'); + $neutral: daff-theme.daff-map-get($theme, 'core', 'neutral'); + $base: branding-theme.daff-map-get($theme, 'core', 'base'); + $base-contrast: branding-theme.daff-map-get($theme, 'core', 'base-contrast'); .daff-branding-logo { fill: daff-theme.daff-illuminate($base-contrast, $neutral, 1); diff --git a/libs/branding/src/scss/branding-theme.scss b/libs/branding/src/scss/branding-theme.scss index c62639163c..f621b007cf 100644 --- a/libs/branding/src/scss/branding-theme.scss +++ b/libs/branding/src/scss/branding-theme.scss @@ -13,5 +13,5 @@ $tertiary-dark: daff-theme.daff-configure-palette(daff-theme.$daff-turquoise, 50 $theme-dark: daff-theme.daff-configure-theme($primary-dark, $secondary-dark, $tertiary-dark, 'dark'); -$black: daff-theme.daff-map-deep-get($theme, 'core.black'); -$white: daff-theme.daff-map-deep-get($theme, 'core.white'); +$black: daff-theme.daff-map-get($theme, 'core', 'black'); +$white: daff-theme.daff-map-get($theme, 'core', 'white'); diff --git a/libs/design/accordion/src/accordion-theme.scss b/libs/design/accordion/src/accordion-theme.scss index 392ffcb3c5..5d61d00814 100644 --- a/libs/design/accordion/src/accordion-theme.scss +++ b/libs/design/accordion/src/accordion-theme.scss @@ -3,8 +3,8 @@ @use '../../scss/theming'; @mixin daff-accordion-theme($theme) { - $neutral: core.daff-map-deep-get($theme, 'core.neutral'); - $base: core.daff-map-deep-get($theme, 'core.base'); + $neutral: core.daff-map-get($theme, 'core', 'neutral'); + $base: core.daff-map-get($theme, 'core', 'base'); .daff-accordion-item { border-top: 1px solid theming.daff-illuminate($base, $neutral, 2); diff --git a/libs/design/article/src/article-theme.scss b/libs/design/article/src/article-theme.scss index cb613bf0f1..9daad7b3dc 100644 --- a/libs/design/article/src/article-theme.scss +++ b/libs/design/article/src/article-theme.scss @@ -7,11 +7,11 @@ $primary: map.get($theme, primary); $secondary: map.get($theme, secondary); $tertiary: map.get($theme, tertiary); - $base: core.daff-map-deep-get($theme, 'core.base'); - $base-contrast: core.daff-map-deep-get($theme, 'core.base-contrast'); - $white: core.daff-map-deep-get($theme, 'core.white'); - $black: core.daff-map-deep-get($theme, 'core.black'); - $neutral: core.daff-map-deep-get($theme, 'core.neutral'); + $base: core.daff-map-get($theme, 'core', 'base'); + $base-contrast: core.daff-map-get($theme, 'core', 'base-contrast'); + $white: core.daff-map-get($theme, 'core', 'white'); + $black: core.daff-map-get($theme, 'core', 'black'); + $neutral: core.daff-map-get($theme, 'core', 'neutral'); $text-color: theming.daff-illuminate($base-contrast, $neutral, 2); $table-border-color: theming.daff-illuminate($base, $neutral, 2); diff --git a/libs/design/breadcrumb/src/breadcrumb-theme.scss b/libs/design/breadcrumb/src/breadcrumb-theme.scss index 530bbd6eed..c005c7fcd4 100644 --- a/libs/design/breadcrumb/src/breadcrumb-theme.scss +++ b/libs/design/breadcrumb/src/breadcrumb-theme.scss @@ -3,9 +3,9 @@ @use '../../scss/theming'; @mixin daff-breadcrumb-theme($theme) { - $base: core.daff-map-deep-get($theme, 'core.base'); - $base-contrast: core.daff-map-deep-get($theme, 'core.base-contrast'); - $neutral: core.daff-map-deep-get($theme, 'core.neutral'); + $base: core.daff-map-get($theme, 'core', 'base'); + $base-contrast: core.daff-map-get($theme, 'core', 'base-contrast'); + $neutral: core.daff-map-get($theme, 'core', 'neutral'); .daff-breadcrumb__item { color: theming.daff-illuminate($base-contrast, $neutral, 4); diff --git a/libs/design/button/src/button/basic/button-theme.scss b/libs/design/button/src/button/basic/button-theme.scss index 87521b16b1..18ea4d40f1 100644 --- a/libs/design/button/src/button/basic/button-theme.scss +++ b/libs/design/button/src/button/basic/button-theme.scss @@ -35,11 +35,11 @@ $warn: map.get($theme, warn); $critical: map.get($theme, critical); $success: map.get($theme, success); - $base: core.daff-map-deep-get($theme, 'core.base'); - $base-contrast: core.daff-map-deep-get($theme, 'core.base-contrast'); - $white: core.daff-map-deep-get($theme, 'core.white'); - $black: core.daff-map-deep-get($theme, 'core.black'); - $neutral: core.daff-map-deep-get($theme, 'core.neutral'); + $base: core.daff-map-get($theme, 'core', 'base'); + $base-contrast: core.daff-map-get($theme, 'core', 'base-contrast'); + $white: core.daff-map-get($theme, 'core', 'white'); + $black: core.daff-map-get($theme, 'core', 'black'); + $neutral: core.daff-map-get($theme, 'core', 'neutral'); .daff-button { @include daff-button-theme-variant( diff --git a/libs/design/button/src/button/flat/flat-theme.scss b/libs/design/button/src/button/flat/flat-theme.scss index 7532854e72..fb1d567403 100644 --- a/libs/design/button/src/button/flat/flat-theme.scss +++ b/libs/design/button/src/button/flat/flat-theme.scss @@ -2,10 +2,7 @@ @use '../../../../scss/theming'; @use '../../../../scss/core'; -@mixin daff-flat-button-theme-variant( - $base-color, - $active-color -) { +@mixin daff-flat-button-theme-variant($base-color, $active-color) { color: $base-color; &::after { @@ -33,11 +30,11 @@ $warn: map.get($theme, warn); $critical: map.get($theme, critical); $success: map.get($theme, success); - $base: core.daff-map-deep-get($theme, 'core.base'); - $base-contrast: core.daff-map-deep-get($theme, 'core.base-contrast'); - $white: core.daff-map-deep-get($theme, 'core.white'); - $black: core.daff-map-deep-get($theme, 'core.black'); - $neutral: core.daff-map-deep-get($theme, 'core.neutral'); + $base: core.daff-map-get($theme, 'core', 'base'); + $base-contrast: core.daff-map-get($theme, 'core', 'base-contrast'); + $white: core.daff-map-get($theme, 'core', 'white'); + $black: core.daff-map-get($theme, 'core', 'black'); + $neutral: core.daff-map-get($theme, 'core', 'neutral'); .daff-flat-button { color: currentColor; @@ -54,7 +51,9 @@ &:hover, &:active { - color: theming.daff-text-contrast(theming.daff-illuminate($base, $neutral, 2)); + color: theming.daff-text-contrast( + theming.daff-illuminate($base, $neutral, 2) + ); } &.daff-primary { diff --git a/libs/design/button/src/button/icon/icon-theme.scss b/libs/design/button/src/button/icon/icon-theme.scss index 9ffaa372c1..759661ae3a 100644 --- a/libs/design/button/src/button/icon/icon-theme.scss +++ b/libs/design/button/src/button/icon/icon-theme.scss @@ -13,8 +13,7 @@ color: $hover-color; @if $base-color == currentColor { opacity: 0.8; - } - @else { + } @else { opacity: 1; } } @@ -32,11 +31,11 @@ $warn: map.get($theme, warn); $critical: map.get($theme, critical); $success: map.get($theme, success); - $base: core.daff-map-deep-get($theme, 'core.base'); - $base-contrast: core.daff-map-deep-get($theme, 'core.base-contrast'); - $white: core.daff-map-deep-get($theme, 'core.white'); - $black: core.daff-map-deep-get($theme, 'core.black'); - $neutral: core.daff-map-deep-get($theme, 'core.neutral'); + $base: core.daff-map-get($theme, 'core', 'base'); + $base-contrast: core.daff-map-get($theme, 'core', 'base-contrast'); + $white: core.daff-map-get($theme, 'core', 'white'); + $black: core.daff-map-get($theme, 'core', 'black'); + $neutral: core.daff-map-get($theme, 'core', 'neutral'); .daff-icon-button { @include daff-icon-button-theme-variant( diff --git a/libs/design/button/src/button/raised/raised-theme.scss b/libs/design/button/src/button/raised/raised-theme.scss index 22f6665dee..1f7e0d08b3 100644 --- a/libs/design/button/src/button/raised/raised-theme.scss +++ b/libs/design/button/src/button/raised/raised-theme.scss @@ -2,29 +2,29 @@ @use '../../../../scss/theming'; @use '../../../../scss/core'; -@mixin daff-raised-button-theme-variant( - $base-color, -) { - @if theming.daff-contrast-ratio($base-color, theming.daff-text-contrast($base-color)) < 4.5 { +@mixin daff-raised-button-theme-variant($base-color) { + @if theming.daff-contrast-ratio( + $base-color, + theming.daff-text-contrast($base-color) + ) < 4.5 { @error 'Button Initial State: ' + map.get(a11y.$wcag-aa-errors, 'text-contrast'); } - @if theming.daff-contrast-ratio($base-color, theming.daff-text-contrast($base-color)) < 4.5 { + @if theming.daff-contrast-ratio( + $base-color, + theming.daff-text-contrast($base-color) + ) < 4.5 { @error 'Button Hover State: ' + map.get(a11y.$wcag-aa-errors, 'text-contrast'); } $black: theming.daff-color(theming.$daff-neutral, 110); background-color: $base-color; border: 1px solid $base-color; - box-shadow: - 0 3px 5px rgba($black, 0.12), - 0 1px 3px rgba($black, 0.08); + box-shadow: 0 3px 5px rgba($black, 0.12), 0 1px 3px rgba($black, 0.08); color: theming.daff-text-contrast($base-color); &::after { - box-shadow: - 0 6px 12px rgba($black, 0.08), - 0 4px 6px rgba($black, 0.04); + box-shadow: 0 6px 12px rgba($black, 0.08), 0 4px 6px rgba($black, 0.04); } &:hover { @@ -41,11 +41,11 @@ $warn: map.get($theme, warn); $critical: map.get($theme, critical); $success: map.get($theme, success); - $base: core.daff-map-deep-get($theme, 'core.base'); - $base-contrast: core.daff-map-deep-get($theme, 'core.base-contrast'); - $white: core.daff-map-deep-get($theme, 'core.white'); - $black: core.daff-map-deep-get($theme, 'core.black'); - $neutral: core.daff-map-deep-get($theme, 'core.neutral'); + $base: core.daff-map-get($theme, 'core', 'base'); + $base-contrast: core.daff-map-get($theme, 'core', 'base-contrast'); + $white: core.daff-map-get($theme, 'core', 'white'); + $black: core.daff-map-get($theme, 'core', 'black'); + $neutral: core.daff-map-get($theme, 'core', 'neutral'); .daff-raised-button { @include daff-raised-button-theme-variant( @@ -53,21 +53,15 @@ ); &.daff-primary { - @include daff-raised-button-theme-variant( - theming.daff-color($primary) - ); + @include daff-raised-button-theme-variant(theming.daff-color($primary)); } &.daff-secondary { - @include daff-raised-button-theme-variant( - theming.daff-color($secondary) - ); + @include daff-raised-button-theme-variant(theming.daff-color($secondary)); } &.daff-tertiary { - @include daff-raised-button-theme-variant( - theming.daff-color($tertiary) - ); + @include daff-raised-button-theme-variant(theming.daff-color($tertiary)); } &.daff-black { @@ -99,21 +93,15 @@ } &.daff-warn { - @include daff-raised-button-theme-variant( - theming.daff-color($warn) - ); + @include daff-raised-button-theme-variant(theming.daff-color($warn)); } &.daff-critical { - @include daff-raised-button-theme-variant( - theming.daff-color($critical) - ); + @include daff-raised-button-theme-variant(theming.daff-color($critical)); } &.daff-success { - @include daff-raised-button-theme-variant( - theming.daff-color($success) - ); + @include daff-raised-button-theme-variant(theming.daff-color($success)); } } } diff --git a/libs/design/button/src/button/stroked/stroked-theme.scss b/libs/design/button/src/button/stroked/stroked-theme.scss index f3e156e5b3..449ebc1c9b 100644 --- a/libs/design/button/src/button/stroked/stroked-theme.scss +++ b/libs/design/button/src/button/stroked/stroked-theme.scss @@ -2,10 +2,7 @@ @use '../../../../scss/theming'; @use '../../../../scss/core'; -@mixin daff-stroked-button-theme-variant( - $base-color, - $active-color -) { +@mixin daff-stroked-button-theme-variant($base-color, $active-color) { border: 1px solid $base-color; color: $base-color; background-color: transparent; @@ -36,11 +33,11 @@ $warn: map.get($theme, warn); $critical: map.get($theme, critical); $success: map.get($theme, success); - $base: core.daff-map-deep-get($theme, 'core.base'); - $base-contrast: core.daff-map-deep-get($theme, 'core.base-contrast'); - $white: core.daff-map-deep-get($theme, 'core.white'); - $black: core.daff-map-deep-get($theme, 'core.black'); - $neutral: core.daff-map-deep-get($theme, 'core.neutral'); + $base: core.daff-map-get($theme, 'core', 'base'); + $base-contrast: core.daff-map-get($theme, 'core', 'base-contrast'); + $white: core.daff-map-get($theme, 'core', 'white'); + $black: core.daff-map-get($theme, 'core', 'black'); + $neutral: core.daff-map-get($theme, 'core', 'neutral'); .daff-stroked-button { background: transparent; diff --git a/libs/design/button/src/button/underline/underline-theme.scss b/libs/design/button/src/button/underline/underline-theme.scss index 7b5b0dde09..720af9cb77 100644 --- a/libs/design/button/src/button/underline/underline-theme.scss +++ b/libs/design/button/src/button/underline/underline-theme.scss @@ -2,9 +2,7 @@ @use '../../../../scss/theming'; @use '../../../../scss/core'; -@mixin daff-underline-button-theme-variant( - $base-color: currentColor, -) { +@mixin daff-underline-button-theme-variant($base-color: currentColor) { color: $base-color; &::after { @@ -20,11 +18,11 @@ $warn: map.get($theme, warn); $critical: map.get($theme, critical); $success: map.get($theme, success); - $base: core.daff-map-deep-get($theme, 'core.base'); - $base-contrast: core.daff-map-deep-get($theme, 'core.base-contrast'); - $white: core.daff-map-deep-get($theme, 'core.white'); - $black: core.daff-map-deep-get($theme, 'core.black'); - $neutral: core.daff-map-deep-get($theme, 'core.neutral'); + $base: core.daff-map-get($theme, 'core', 'base'); + $base-contrast: core.daff-map-get($theme, 'core', 'base-contrast'); + $white: core.daff-map-get($theme, 'core', 'white'); + $black: core.daff-map-get($theme, 'core', 'black'); + $neutral: core.daff-map-get($theme, 'core', 'neutral'); .daff-underline-button { @include daff-underline-button-theme-variant( @@ -73,9 +71,7 @@ } &.daff-warn { - @include daff-underline-button-theme-variant( - theming.daff-color($warn) - ); + @include daff-underline-button-theme-variant(theming.daff-color($warn)); } &.daff-critical { diff --git a/libs/design/callout/src/callout-theme.scss b/libs/design/callout/src/callout-theme.scss index 217b70a87b..3b0dbd6baa 100644 --- a/libs/design/callout/src/callout-theme.scss +++ b/libs/design/callout/src/callout-theme.scss @@ -11,11 +11,11 @@ $primary: map.get($theme, primary); $secondary: map.get($theme, secondary); $tertiary: map.get($theme, tertiary); - $neutral: core.daff-map-deep-get($theme, 'core.neutral'); - $base: core.daff-map-deep-get($theme, 'core.base'); - $base-contrast: core.daff-map-deep-get($theme, 'core.base-contrast'); - $white: core.daff-map-deep-get($theme, 'core.white'); - $black: core.daff-map-deep-get($theme, 'core.black'); + $neutral: core.daff-map-get($theme, 'core', 'neutral'); + $base: core.daff-map-get($theme, 'core', 'base'); + $base-contrast: core.daff-map-get($theme, 'core', 'base-contrast'); + $white: core.daff-map-get($theme, 'core', 'white'); + $black: core.daff-map-get($theme, 'core', 'black'); .daff-callout { @include daff-callout-theme-variant( @@ -23,21 +23,15 @@ ); &.daff-primary { - @include daff-callout-theme-variant( - theming.daff-color($primary) - ); + @include daff-callout-theme-variant(theming.daff-color($primary)); } &.daff-secondary { - @include daff-callout-theme-variant( - theming.daff-color($secondary) - ); + @include daff-callout-theme-variant(theming.daff-color($secondary)); } &.daff-tertiary { - @include daff-callout-theme-variant( - theming.daff-color($tertiary) - ); + @include daff-callout-theme-variant(theming.daff-color($tertiary)); } &.daff-theme { diff --git a/libs/design/card/src/card-theme.scss b/libs/design/card/src/card-theme.scss index 475ae1e54a..32be481fc5 100644 --- a/libs/design/card/src/card-theme.scss +++ b/libs/design/card/src/card-theme.scss @@ -9,11 +9,11 @@ $primary: map.get($theme, primary); $secondary: map.get($theme, secondary); $tertiary: map.get($theme, tertiary); - $base: core.daff-map-deep-get($theme, 'core.base'); - $base-contrast: core.daff-map-deep-get($theme, 'core.base-contrast'); - $white: core.daff-map-deep-get($theme, 'core.white'); - $black: core.daff-map-deep-get($theme, 'core.black'); - $neutral: core.daff-map-deep-get($theme, 'core.neutral'); + $base: core.daff-map-get($theme, 'core', 'base'); + $base-contrast: core.daff-map-get($theme, 'core', 'base-contrast'); + $white: core.daff-map-get($theme, 'core', 'white'); + $black: core.daff-map-get($theme, 'core', 'black'); + $neutral: core.daff-map-get($theme, 'core', 'neutral'); .daff-card { $root: &; diff --git a/libs/design/hero/src/hero-theme.scss b/libs/design/hero/src/hero-theme.scss index 27ce391db4..ff45a09c8a 100644 --- a/libs/design/hero/src/hero-theme.scss +++ b/libs/design/hero/src/hero-theme.scss @@ -11,11 +11,11 @@ $primary: map.get($theme, primary); $secondary: map.get($theme, secondary); $tertiary: map.get($theme, tertiary); - $neutral: core.daff-map-deep-get($theme, 'core.neutral'); - $base: core.daff-map-deep-get($theme, 'core.base'); - $base-contrast: core.daff-map-deep-get($theme, 'core.base-contrast'); - $white: core.daff-map-deep-get($theme, 'core.white'); - $black: core.daff-map-deep-get($theme, 'core.black'); + $neutral: core.daff-map-get($theme, 'core', 'neutral'); + $base: core.daff-map-get($theme, 'core', 'base'); + $base-contrast: core.daff-map-get($theme, 'core', 'base-contrast'); + $white: core.daff-map-get($theme, 'core', 'white'); + $black: core.daff-map-get($theme, 'core', 'black'); .daff-hero { @include daff-hero-theme-variant( @@ -23,21 +23,15 @@ ); &.daff-primary { - @include daff-hero-theme-variant( - theming.daff-color($primary) - ); + @include daff-hero-theme-variant(theming.daff-color($primary)); } &.daff-secondary { - @include daff-hero-theme-variant( - theming.daff-color($secondary) - ); + @include daff-hero-theme-variant(theming.daff-color($secondary)); } &.daff-tertiary { - @include daff-hero-theme-variant( - theming.daff-color($tertiary) - ); + @include daff-hero-theme-variant(theming.daff-color($tertiary)); } &.daff-theme { diff --git a/libs/design/list/src/list-theme.scss b/libs/design/list/src/list-theme.scss index ba29d96f0d..0415f87abf 100644 --- a/libs/design/list/src/list-theme.scss +++ b/libs/design/list/src/list-theme.scss @@ -4,18 +4,20 @@ // styleline-disable selector-class-pattern @mixin daff-list-theme($theme) { - $neutral: core.daff-map-deep-get($theme, 'core.neutral'); - $base: core.daff-map-deep-get($theme, 'core.base'); - $base-contrast: core.daff-map-deep-get($theme, 'core.base-contrast'); + $neutral: core.daff-map-get($theme, 'core', 'neutral'); + $base: core.daff-map-get($theme, 'core', 'base'); + $base-contrast: core.daff-map-get($theme, 'core', 'base-contrast'); .daff-list { .daff-list-item { &__content { - *:nth-child(1) { /* stylelint-disable-line scss/selector-nest-combinators */ + *:nth-child(1) { + /* stylelint-disable-line scss/selector-nest-combinators */ color: $base-contrast; } - *:nth-child(n + 2) { /* stylelint-disable-line scss/selector-nest-combinators */ + *:nth-child(n + 2) { + /* stylelint-disable-line scss/selector-nest-combinators */ color: theming.daff-illuminate($base-contrast, $neutral, 3); } } diff --git a/libs/design/loading-icon/src/loading-icon-theme.scss b/libs/design/loading-icon/src/loading-icon-theme.scss index 1507f1da7e..1367586e8f 100644 --- a/libs/design/loading-icon/src/loading-icon-theme.scss +++ b/libs/design/loading-icon/src/loading-icon-theme.scss @@ -6,10 +6,10 @@ $primary: map.get($theme, primary); $secondary: map.get($theme, secondary); $tertiary: map.get($theme, tertiary); - $base: core.daff-map-deep-get($theme, 'core.base'); - $base-contrast: core.daff-map-deep-get($theme, 'core.base-contrast'); - $white: core.daff-map-deep-get($theme, 'core.white'); - $black: core.daff-map-deep-get($theme, 'core.black'); + $base: core.daff-map-get($theme, 'core', 'base'); + $base-contrast: core.daff-map-get($theme, 'core', 'base-contrast'); + $white: core.daff-map-get($theme, 'core', 'white'); + $black: core.daff-map-get($theme, 'core', 'black'); .daff-loading-icon { &__loader { diff --git a/libs/design/media-gallery/src/media-gallery-theme.scss b/libs/design/media-gallery/src/media-gallery-theme.scss index 7252b6776d..a915001ef1 100644 --- a/libs/design/media-gallery/src/media-gallery-theme.scss +++ b/libs/design/media-gallery/src/media-gallery-theme.scss @@ -3,7 +3,7 @@ @use '../../scss/core'; @mixin daff-media-gallery-theme($theme) { - $neutral: core.daff-map-deep-get($theme, 'core.neutral'); + $neutral: core.daff-map-get($theme, 'core', 'neutral'); .daff-media-gallery { $root: &; diff --git a/libs/design/menu/src/menu-theme.scss b/libs/design/menu/src/menu-theme.scss index 83daf947e8..8fba62db83 100644 --- a/libs/design/menu/src/menu-theme.scss +++ b/libs/design/menu/src/menu-theme.scss @@ -2,11 +2,11 @@ @use '../../scss/theming'; @mixin daff-menu-theme($theme) { - $white: core.daff-map-deep-get($theme, 'core.white'); - $black: core.daff-map-deep-get($theme, 'core.black'); - $neutral: core.daff-map-deep-get($theme, 'core.neutral'); - $base: core.daff-map-deep-get($theme, 'core.base'); - $base-contrast: core.daff-map-deep-get($theme, 'core.base-contrast'); + $white: core.daff-map-get($theme, 'core', 'white'); + $black: core.daff-map-get($theme, 'core', 'black'); + $neutral: core.daff-map-get($theme, 'core', 'neutral'); + $base: core.daff-map-get($theme, 'core', 'base'); + $base-contrast: core.daff-map-get($theme, 'core', 'base-contrast'); .daff-menu { background: $base; diff --git a/libs/design/modal/src/modal-theme.scss b/libs/design/modal/src/modal-theme.scss index faac0d3896..fa6d40e46d 100644 --- a/libs/design/modal/src/modal-theme.scss +++ b/libs/design/modal/src/modal-theme.scss @@ -1,7 +1,7 @@ @use '../../scss/core'; @mixin daff-modal-theme($theme) { - $base: core.daff-map-deep-get($theme, 'core.base'); + $base: core.daff-map-get($theme, 'core', 'base'); .daff-modal { background: $base; diff --git a/libs/design/navbar/src/navbar-theme.scss b/libs/design/navbar/src/navbar-theme.scss index 392b37a683..bd72baa6f9 100644 --- a/libs/design/navbar/src/navbar-theme.scss +++ b/libs/design/navbar/src/navbar-theme.scss @@ -11,11 +11,11 @@ $primary: map.get($theme, primary); $secondary: map.get($theme, secondary); $tertiary: map.get($theme, tertiary); - $neutral: core.daff-map-deep-get($theme, 'core.neutral'); - $base: core.daff-map-deep-get($theme, 'core.base'); - $base-contrast: core.daff-map-deep-get($theme, 'core.base-contrast'); - $white: core.daff-map-deep-get($theme, 'core.white'); - $black: core.daff-map-deep-get($theme, 'core.black'); + $neutral: core.daff-map-get($theme, 'core', 'neutral'); + $base: core.daff-map-get($theme, 'core', 'base'); + $base-contrast: core.daff-map-get($theme, 'core', 'base-contrast'); + $white: core.daff-map-get($theme, 'core', 'white'); + $black: core.daff-map-get($theme, 'core', 'black'); .daff-navbar { @include daff-navbar-theme-variant( diff --git a/libs/design/notification/src/notification-theme.scss b/libs/design/notification/src/notification-theme.scss index 3498170133..86054cc94d 100644 --- a/libs/design/notification/src/notification-theme.scss +++ b/libs/design/notification/src/notification-theme.scss @@ -10,11 +10,11 @@ $warn: map.get($theme, warn); $critical: map.get($theme, critical); $success: map.get($theme, success); - $neutral: core.daff-map-deep-get($theme, 'core.neutral'); - $base: core.daff-map-deep-get($theme, 'core.base'); - $base-contrast: core.daff-map-deep-get($theme, 'core.base-contrast'); - $white: core.daff-map-deep-get($theme, 'core.white'); - $black: core.daff-map-deep-get($theme, 'core.black'); + $neutral: core.daff-map-get($theme, 'core', 'neutral'); + $base: core.daff-map-get($theme, 'core', 'base'); + $base-contrast: core.daff-map-get($theme, 'core', 'base-contrast'); + $white: core.daff-map-get($theme, 'core', 'white'); + $black: core.daff-map-get($theme, 'core', 'black'); .daff-notification { background: theming.daff-illuminate($base, $neutral, 1); diff --git a/libs/design/paginator/src/paginator-theme.scss b/libs/design/paginator/src/paginator-theme.scss index 3342c4749f..c910461a2f 100644 --- a/libs/design/paginator/src/paginator-theme.scss +++ b/libs/design/paginator/src/paginator-theme.scss @@ -6,12 +6,12 @@ $primary: map.get($theme, primary); $secondary: map.get($theme, secondary); $tertiary: map.get($theme, tertiary); - $base: core.daff-map-deep-get($theme, 'core.base'); - $base-contrast: core.daff-map-deep-get($theme, 'core.base-contrast'); - $white: core.daff-map-deep-get($theme, 'core.white'); - $black: core.daff-map-deep-get($theme, 'core.black'); - $neutral: core.daff-map-deep-get($theme, 'core.neutral'); - $font-color: core.daff-map-deep-get($theme, 'core.font-color'); + $base: core.daff-map-get($theme, 'core', 'base'); + $base-contrast: core.daff-map-get($theme, 'core', 'base-contrast'); + $white: core.daff-map-get($theme, 'core', 'white'); + $black: core.daff-map-get($theme, 'core', 'black'); + $neutral: core.daff-map-get($theme, 'core', 'neutral'); + $font-color: core.daff-map-get($theme, 'core', 'font-color'); .daff-paginator { &__previous, diff --git a/libs/design/progress-bar/src/progress-bar-theme.scss b/libs/design/progress-bar/src/progress-bar-theme.scss index b7f3337460..469563a34f 100644 --- a/libs/design/progress-bar/src/progress-bar-theme.scss +++ b/libs/design/progress-bar/src/progress-bar-theme.scss @@ -6,11 +6,11 @@ $primary: map.get($theme, primary); $secondary: map.get($theme, secondary); $tertiary: map.get($theme, tertiary); - $base: core.daff-map-deep-get($theme, 'core.base'); - $base-contrast: core.daff-map-deep-get($theme, 'core.base-contrast'); - $white: core.daff-map-deep-get($theme, 'core.white'); - $black: core.daff-map-deep-get($theme, 'core.black'); - $neutral: core.daff-map-deep-get($theme, 'core.neutral'); + $base: core.daff-map-get($theme, 'core', 'base'); + $base-contrast: core.daff-map-get($theme, 'core', 'base-contrast'); + $white: core.daff-map-get($theme, 'core', 'white'); + $black: core.daff-map-get($theme, 'core', 'black'); + $neutral: core.daff-map-get($theme, 'core', 'neutral'); .daff-progress-bar { $root: '.daff-progress-bar'; diff --git a/libs/design/scss/core/_index.scss b/libs/design/scss/core/_index.scss index faae793e7c..e9881b0ccf 100644 --- a/libs/design/scss/core/_index.scss +++ b/libs/design/scss/core/_index.scss @@ -1,5 +1,3 @@ @forward 'string/split/string-split'; -@forward 'map/map-deep-check/map-deep-check'; -@forward 'map/map-deep-get/map-deep-get'; @forward 'map/map-get/map-get'; diff --git a/libs/design/scss/core/map/map-deep-check/map-deep-check.spec.scss b/libs/design/scss/core/map/map-deep-check/map-deep-check.spec.scss deleted file mode 100644 index 2cbf085c2e..0000000000 --- a/libs/design/scss/core/map/map-deep-check/map-deep-check.spec.scss +++ /dev/null @@ -1,43 +0,0 @@ -@use 'true' as *; -@use './map-deep-check' as *; - -@include describe('map-deep-check') { - $map: ( - 'nested': ( - 'string': '1', - 'number': 2, - 'map': ( - 'string': '3', - 'number': 4 - ) - ) - ); - - @include it('returns `true` if the map contains the key') { - @include assert-equal( - daff-map-deep-check($map, ('nested', 'string')), - true - ); - @include assert-equal( - daff-map-deep-check($map, ('nested', 'number')), - true - ); - @include assert-equal(daff-map-deep-check($map, ('nested', 'map')), true); - @include assert-equal( - daff-map-deep-check($map, ('nested', 'map', 'string')), - true - ); - @include assert-equal( - daff-map-deep-check($map, ('nested', 'map', 'number')), - true - ); - } - - @include it('should return false if the $key is not in the list') { - @include assert-equal( - daff-map-deep-check($map, ('UNREALKEY', 'TEST')), - false - ); - @include assert-equal(daff-map-deep-check($map, ('SOMEOTHER')), false); - } -} diff --git a/libs/design/scss/core/map/map-deep-get/map-deep-get.spec.scss b/libs/design/scss/core/map/map-deep-get/map-deep-get.spec.scss deleted file mode 100644 index 107cde6d19..0000000000 --- a/libs/design/scss/core/map/map-deep-get/map-deep-get.spec.scss +++ /dev/null @@ -1,25 +0,0 @@ -@use 'true' as *; -@use './map-deep-get' as *; - -@include describe('map-deep-get') { - $nested-map: ( - 'string': '3', - 'number': 4 - ); - - $map: ( - 'nested': ( - 'string': '1', - 'number': 2, - 'map': $nested-map - ) - ); - - @include it('returns the value of the nested key if it exists in the map') { - @include assert-equal(daff-map-deep-get($map, ('nested.string')), '1'); - @include assert-equal(daff-map-deep-get($map, ('nested.number')), 2); - @include assert-equal(daff-map-deep-get($map, ('nested.map')), $nested-map); - @include assert-equal(daff-map-deep-get($map, ('nested.map.string')), '3'); - @include assert-equal(daff-map-deep-get($map, ('nested.map.number')), 4); - } -} diff --git a/libs/design/scss/core/map/map-get/map-get.spec.scss b/libs/design/scss/core/map/map-get/map-get.spec.scss index 484a1f5b50..98deeaf26d 100644 --- a/libs/design/scss/core/map/map-get/map-get.spec.scss +++ b/libs/design/scss/core/map/map-get/map-get.spec.scss @@ -5,30 +5,30 @@ @include describe('map-get') { $nested-map: ( 'string': '3', - 'number': 4 + 'number': 4, ); $map: ( 'nested': ( 'string': '1', 'number': 2, - 'map': $nested-map - ) + 'map': $nested-map, + ), ); - $deep-map: ( - 'level1': ( - 'level2': ( - 'level3': ( - 'level': 4 - ) - ) - ) - ); + $deep-map: ( + 'level1': ( + 'level2': ( + 'level3': ( + 'level': 4, + ), + ), + ), + ); $empty-map: (); - @include map-get-error.set-debug(true); + @include map-get-error.set-debug(true); @include it('returns the value of the nested key if it exists in the map') { @include assert-equal(daff-map-get($map, 'nested', 'string'), '1'); @@ -38,11 +38,16 @@ @include assert-equal(daff-map-get($map, 'nested', 'map', 'number'), 4); } - @include it('returns the correct value for deeply nested maps') { - @include assert-equal(daff-map-get($deep-map, 'level1', 'level2', 'level3', 'level'), 4); - } + @include it('returns the correct value for deeply nested maps') { + @include assert-equal( + daff-map-get($deep-map, 'level1', 'level2', 'level3', 'level'), + 4 + ); + } - @include it('errors if the value of the nested key does not exist in the map') { + @include it( + 'errors if the value of the nested key does not exist in the map' + ) { @include assert-equal( daff-map-get($map, 'missing'), "The map doesn't contain the $key: `missing`'" @@ -56,5 +61,5 @@ ); } - @include map-get-error.set-debug(false); + @include map-get-error.set-debug(false); } diff --git a/libs/design/scss/state/skeleton/_mixins.scss b/libs/design/scss/state/skeleton/_mixins.scss index 96dbb831aa..a3f1aae614 100644 --- a/libs/design/scss/state/skeleton/_mixins.scss +++ b/libs/design/scss/state/skeleton/_mixins.scss @@ -2,8 +2,8 @@ @use '../../theming'; @mixin daff-skeleton-theme($theme) { - $neutral: core.daff-map-deep-get($theme, 'core.neutral'); - $base: core.daff-map-deep-get($theme, 'core.base'); + $neutral: core.daff-map-get($theme, 'core', 'neutral'); + $base: core.daff-map-get($theme, 'core', 'base'); .daff-skeleton { &::before, diff --git a/libs/design/scss/theming/_daff-theme.scss b/libs/design/scss/theming/_daff-theme.scss index 3e159af2c4..f3a5f81e64 100644 --- a/libs/design/scss/theming/_daff-theme.scss +++ b/libs/design/scss/theming/_daff-theme.scss @@ -25,5 +25,5 @@ $theme-dark: configure-theme.daff-configure-theme( 'dark' ); -$black: core.daff-map-deep-get($theme, 'core.black'); -$white: core.daff-map-deep-get($theme, 'core.white'); +$black: core.daff-map-get($theme, 'core', 'black'); +$white: core.daff-map-get($theme, 'core', 'white'); \ No newline at end of file diff --git a/libs/design/scss/theming/_theme-css-variables.scss b/libs/design/scss/theming/_theme-css-variables.scss index 061e077a5a..c7c61bfb26 100644 --- a/libs/design/scss/theming/_theme-css-variables.scss +++ b/libs/design/scss/theming/_theme-css-variables.scss @@ -7,14 +7,14 @@ // // Global theme tokens @mixin daff-root-theme-tokens($theme) { - $base: core.daff-map-deep-get($theme, 'core.base'); - $base-contrast: core.daff-map-deep-get($theme, 'core.base-contrast'); + $base: core.daff-map-get($theme, 'core', 'base'); + $base-contrast: core.daff-map-get($theme, 'core', 'base-contrast'); $primary: map.get($theme, primary); $secondary: map.get($theme, secondary); $tertiary: map.get($theme, tertiary); - $neutral: core.daff-map-deep-get($theme, 'core.neutral'); - $white: core.daff-map-deep-get($theme, 'core.white'); - $black: core.daff-map-deep-get($theme, 'core.black'); + $neutral: core.daff-map-get($theme, 'core', 'neutral'); + $white: core.daff-map-get($theme, 'core', 'white'); + $black: core.daff-map-get($theme, 'core', 'black'); --daff-theme-rgb: #{color.red($base), color.green($base), color.blue($base)}; --daff-theme-contrast-rgb: #{color.red($base-contrast), color.green($base-contrast), diff --git a/libs/design/sidebar/src/sidebar-theme.scss b/libs/design/sidebar/src/sidebar-theme.scss index b8c5f9d81a..1e15991950 100644 --- a/libs/design/sidebar/src/sidebar-theme.scss +++ b/libs/design/sidebar/src/sidebar-theme.scss @@ -1,9 +1,9 @@ @use '../../scss/core'; @mixin daff-sidebar-theme($theme) { - $base: core.daff-map-deep-get($theme, 'core.base'); - $base-contrast: core.daff-map-deep-get($theme, 'core.base-contrast'); - $font-color: core.daff-map-deep-get($theme, 'core.font-color'); + $base: core.daff-map-get($theme, 'core', 'base'); + $base-contrast: core.daff-map-get($theme, 'core', 'base-contrast'); + $font-color: core.daff-map-get($theme, 'core', 'font-color'); .daff-sidebar { background: $base; diff --git a/libs/design/src/atoms/form/form-field/form-field/form-field-theme.scss b/libs/design/src/atoms/form/form-field/form-field/form-field-theme.scss index cfbac94e11..9ed63347f5 100644 --- a/libs/design/src/atoms/form/form-field/form-field/form-field-theme.scss +++ b/libs/design/src/atoms/form/form-field/form-field/form-field-theme.scss @@ -6,9 +6,9 @@ $primary: map.get($theme, primary); $secondary: map.get($theme, secondary); $tertiary: map.get($theme, tertiary); - $base: core.daff-map-deep-get($theme, 'core.base'); - $base-contrast: core.daff-map-deep-get($theme, 'core.base-contrast'); - $neutral: core.daff-map-deep-get($theme, 'core.neutral'); + $base: core.daff-map-get($theme, 'core', 'base'); + $base-contrast: core.daff-map-get($theme, 'core', 'base-contrast'); + $neutral: core.daff-map-get($theme, 'core', 'neutral'); .daff-form-field { &__control { diff --git a/libs/design/src/atoms/form/input/input-theme.scss b/libs/design/src/atoms/form/input/input-theme.scss index c0f74ecb99..f3677e4e20 100644 --- a/libs/design/src/atoms/form/input/input-theme.scss +++ b/libs/design/src/atoms/form/input/input-theme.scss @@ -2,8 +2,8 @@ @use '../../../../scss/theming'; @mixin daff-input-theme($theme) { - $base: core.daff-map-deep-get($theme, 'core.base'); - $base-contrast: core.daff-map-deep-get($theme, 'core.base-contrast'); + $base: core.daff-map-get($theme, 'core', 'base'); + $base-contrast: core.daff-map-get($theme, 'core', 'base-contrast'); :host { background: $base; diff --git a/libs/design/src/atoms/form/native-select/native-select-theme.scss b/libs/design/src/atoms/form/native-select/native-select-theme.scss index a51460c154..67aaebeac4 100644 --- a/libs/design/src/atoms/form/native-select/native-select-theme.scss +++ b/libs/design/src/atoms/form/native-select/native-select-theme.scss @@ -3,9 +3,9 @@ @use '../../../../scss/theming'; @mixin daff-native-select-theme($theme) { - $neutral: core.daff-map-deep-get($theme, 'core.neutral'); - $base-contrast: core.daff-map-deep-get($theme, 'core.base-contrast'); - $black: core.daff-map-deep-get($theme, 'core.black'); + $neutral: core.daff-map-get($theme, 'core', 'neutral'); + $base-contrast: core.daff-map-get($theme, 'core', 'base-contrast'); + $black: core.daff-map-get($theme, 'core', 'black'); .daff-native-select { color: theming.daff-illuminate($base-contrast, $neutral, 4); diff --git a/libs/design/tabs/src/tabs-theme.scss b/libs/design/tabs/src/tabs-theme.scss index 8671d6e5c3..326ac64d2e 100644 --- a/libs/design/tabs/src/tabs-theme.scss +++ b/libs/design/tabs/src/tabs-theme.scss @@ -6,11 +6,11 @@ $primary: map.get($theme, primary); $secondary: map.get($theme, secondary); $tertiary: map.get($theme, tertiary); - $neutral: core.daff-map-deep-get($theme, 'core.neutral'); - $base: core.daff-map-deep-get($theme, 'core.base'); - $base-contrast: core.daff-map-deep-get($theme, 'core.base-contrast'); - $white: core.daff-map-deep-get($theme, 'core.white'); - $black: core.daff-map-deep-get($theme, 'core.black'); + $neutral: core.daff-map-get($theme, 'core', 'neutral'); + $base: core.daff-map-get($theme, 'core', 'base'); + $base-contrast: core.daff-map-get($theme, 'core', 'base-contrast'); + $white: core.daff-map-get($theme, 'core', 'white'); + $black: core.daff-map-get($theme, 'core', 'black'); .daff-tab-activator { border-bottom: 2px solid theming.daff-illuminate($base, $neutral, 2); diff --git a/libs/design/toast/src/toast-theme.scss b/libs/design/toast/src/toast-theme.scss index d5302b798d..1c5cea8054 100644 --- a/libs/design/toast/src/toast-theme.scss +++ b/libs/design/toast/src/toast-theme.scss @@ -10,11 +10,11 @@ $warn: map.get($theme, warn); $critical: map.get($theme, critical); $success: map.get($theme, success); - $neutral: core.daff-map-deep-get($theme, 'core.neutral'); - $base: core.daff-map-deep-get($theme, 'core.base'); - $base-contrast: core.daff-map-deep-get($theme, 'core.base-contrast'); - $white: core.daff-map-deep-get($theme, 'core.white'); - $black: core.daff-map-deep-get($theme, 'core.black'); + $neutral: core.daff-map-get($theme, 'core', 'neutral'); + $base: core.daff-map-get($theme, 'core', 'base'); + $base-contrast: core.daff-map-get($theme, 'core', 'base-contrast'); + $white: core.daff-map-get($theme, 'core', 'white'); + $black: core.daff-map-get($theme, 'core', 'black'); .daff-toast { background: theming.daff-illuminate($base, $neutral, 1); @@ -33,7 +33,7 @@ color: theming.daff-color($success); } - &::before { + &:before { background: theming.daff-color($success); } } diff --git a/libs/design/tree/src/tree-theme.scss b/libs/design/tree/src/tree-theme.scss index befc6b3ba0..bca93d1a15 100644 --- a/libs/design/tree/src/tree-theme.scss +++ b/libs/design/tree/src/tree-theme.scss @@ -6,11 +6,11 @@ $primary: map.get($theme, primary); $secondary: map.get($theme, secondary); $tertiary: map.get($theme, tertiary); - $base: core.daff-map-deep-get($theme, 'core.base'); - $base-contrast: core.daff-map-deep-get($theme, 'core.base-contrast'); - $white: core.daff-map-deep-get($theme, 'core.white'); - $black: core.daff-map-deep-get($theme, 'core.black'); - $neutral: core.daff-map-deep-get($theme, 'core.neutral'); + $base: core.daff-map-get($theme, 'core', 'base'); + $base-contrast: core.daff-map-get($theme, 'core', 'base-contrast'); + $white: core.daff-map-get($theme, 'core', 'white'); + $black: core.daff-map-get($theme, 'core', 'black'); + $neutral: core.daff-map-get($theme, 'core', 'neutral'); .daff-tree-item { $root: &; From 4982f21dc03f4b81ac85d34d8ac883803eae5ff5 Mon Sep 17 00:00:00 2001 From: gracetxgao <101677420+gracetxgao@users.noreply.github.com> Date: Fri, 13 Dec 2024 12:52:41 -0800 Subject: [PATCH 6/9] refactor: move and rename error-to-string function --- libs/design/scss/core/error/error-to-string.scss | 13 +++++++++++++ .../design/scss/core/map/map-get/map-get-error.scss | 13 ------------- libs/design/scss/core/map/map-get/map-get.scss | 4 ++-- libs/design/scss/core/map/map-get/map-get.spec.scss | 6 +++--- 4 files changed, 18 insertions(+), 18 deletions(-) create mode 100644 libs/design/scss/core/error/error-to-string.scss delete mode 100644 libs/design/scss/core/map/map-get/map-get-error.scss diff --git a/libs/design/scss/core/error/error-to-string.scss b/libs/design/scss/core/error/error-to-string.scss new file mode 100644 index 0000000000..13c2231509 --- /dev/null +++ b/libs/design/scss/core/error/error-to-string.scss @@ -0,0 +1,13 @@ +$use-string: false !default; + +@function error-to-string($message, $override: $use-string) { + @if $override { + @return $message; + } @else { + @error $message; + } +} + +@mixin set-use-string($state: true) { + $use-string: $state !global; +} \ No newline at end of file diff --git a/libs/design/scss/core/map/map-get/map-get-error.scss b/libs/design/scss/core/map/map-get/map-get-error.scss deleted file mode 100644 index d9925d5fa4..0000000000 --- a/libs/design/scss/core/map/map-get/map-get-error.scss +++ /dev/null @@ -1,13 +0,0 @@ -$debug: false !default; - -@function map-get-error($message, $override: $debug) { - @if $override { - @return $message; - } @else { - @error $message; - } -} - -@mixin set-debug($state: true) { - $debug: $state !global; -} \ No newline at end of file diff --git a/libs/design/scss/core/map/map-get/map-get.scss b/libs/design/scss/core/map/map-get/map-get.scss index 2eab9c807a..943658e702 100644 --- a/libs/design/scss/core/map/map-get/map-get.scss +++ b/libs/design/scss/core/map/map-get/map-get.scss @@ -1,5 +1,5 @@ @use 'sass:map'; -@use './map-get-error'; +@use '../../error/error-to-string'; // // Return a the value of a nested key in a map if it exists. @@ -14,7 +14,7 @@ @function daff-map-get($map, $keys...) { @each $key in $keys { @if not map.has-key($map, $key) { - @return map-get-error.map-get-error("The map doesn't contain the $key: `#{$key}`'"); + @return error-to-string.error-to-string("The map doesn't contain the $key: `#{$key}`'"); } $map: map.get($map, $key); } diff --git a/libs/design/scss/core/map/map-get/map-get.spec.scss b/libs/design/scss/core/map/map-get/map-get.spec.scss index 98deeaf26d..cc23e4bd54 100644 --- a/libs/design/scss/core/map/map-get/map-get.spec.scss +++ b/libs/design/scss/core/map/map-get/map-get.spec.scss @@ -1,6 +1,6 @@ @use 'true' as *; @use './map-get' as *; -@use './map-get-error'; +@use '../../error/error-to-string'; @include describe('map-get') { $nested-map: ( @@ -28,7 +28,7 @@ $empty-map: (); - @include map-get-error.set-debug(true); + @include error-to-string.set-use-string(true); @include it('returns the value of the nested key if it exists in the map') { @include assert-equal(daff-map-get($map, 'nested', 'string'), '1'); @@ -61,5 +61,5 @@ ); } - @include map-get-error.set-debug(false); + @include error-to-string.set-use-string(false); } From e0b98322374226cc43b30a4e109836648d67dcc6 Mon Sep 17 00:00:00 2001 From: gracetxgao <101677420+gracetxgao@users.noreply.github.com> Date: Tue, 17 Dec 2024 10:34:18 -0800 Subject: [PATCH 7/9] refactor: update theming values to use daff-map-get --- .../feature-comparison-theme.scss | 2 +- .../app/core/footer/footer/footer-theme.scss | 2 +- .../footer/sub-footer/sub-footer-theme.scss | 2 +- .../components/header/header-theme.scss | 2 +- .../sidebar-footer/sidebar-footer-theme.scss | 2 +- .../src/scss/type-descriptors/_mixins.scss | 22 +++++++++++++------ .../component/code-preview-theme.scss | 2 +- .../sidebar-viewport-theme.scss | 2 +- libs/design/article/src/article-theme.scss | 6 ++--- .../button/src/button/basic/button-theme.scss | 14 ++++++------ .../button/src/button/flat/flat-theme.scss | 14 ++++++------ .../button/src/button/icon/icon-theme.scss | 14 ++++++------ .../src/button/raised/raised-theme.scss | 14 ++++++------ .../src/button/stroked/stroked-theme.scss | 14 ++++++------ .../src/button/underline/underline-theme.scss | 14 ++++++------ libs/design/callout/src/callout-theme.scss | 6 ++--- libs/design/card/src/card-theme.scss | 6 ++--- libs/design/hero/src/hero-theme.scss | 6 ++--- .../loading-icon/src/loading-icon-theme.scss | 6 ++--- libs/design/navbar/src/navbar-theme.scss | 6 ++--- .../notification/src/notification-theme.scss | 14 ++++++------ .../design/paginator/src/paginator-theme.scss | 6 ++--- .../progress-bar/src/progress-bar-theme.scss | 6 ++--- .../scss/theming/_theme-css-variables.scss | 6 ++--- .../form-field/form-field-theme.scss | 6 ++--- libs/design/tabs/src/tabs-theme.scss | 6 ++--- libs/design/toast/src/toast-theme.scss | 14 ++++++------ libs/design/tree/src/tree-theme.scss | 6 ++--- 28 files changed, 114 insertions(+), 106 deletions(-) diff --git a/apps/daffio/src/app/content/why-pwa/components/feature-comparison/feature-comparison-theme.scss b/apps/daffio/src/app/content/why-pwa/components/feature-comparison/feature-comparison-theme.scss index 711d3c6bc1..114800d420 100644 --- a/apps/daffio/src/app/content/why-pwa/components/feature-comparison/feature-comparison-theme.scss +++ b/apps/daffio/src/app/content/why-pwa/components/feature-comparison/feature-comparison-theme.scss @@ -2,7 +2,7 @@ @use 'theme' as daff-theme; @mixin daffio-feature-comparison-theme($theme) { - $secondary: map.get($theme, secondary); + $secondary: daff-theme.daff-map-get($theme, secondary); $base: daff-theme.daff-map-get($theme, 'core', 'base'); $base-contrast: daff-theme.daff-map-get($theme, 'core', 'base-contrast'); diff --git a/apps/daffio/src/app/core/footer/footer/footer-theme.scss b/apps/daffio/src/app/core/footer/footer/footer-theme.scss index eefdbae3e0..99b8fcacc6 100644 --- a/apps/daffio/src/app/core/footer/footer/footer-theme.scss +++ b/apps/daffio/src/app/core/footer/footer/footer-theme.scss @@ -5,7 +5,7 @@ $neutral: daff-theme.daff-map-get($theme, 'core', 'neutral'); $base: daff-theme.daff-map-get($theme, 'core', 'base'); $base-contrast: daff-theme.daff-map-get($theme, 'core', 'base-contrast'); - $secondary: map.get($theme, secondary); + $secondary: daff-theme.daff-map-get($theme, secondary); .daffio-footer { border-top: 1px solid daff-theme.daff-illuminate($base, $neutral, 2); diff --git a/apps/daffio/src/app/core/footer/sub-footer/sub-footer-theme.scss b/apps/daffio/src/app/core/footer/sub-footer/sub-footer-theme.scss index 6e3fac8956..bc9010a753 100644 --- a/apps/daffio/src/app/core/footer/sub-footer/sub-footer-theme.scss +++ b/apps/daffio/src/app/core/footer/sub-footer/sub-footer-theme.scss @@ -2,7 +2,7 @@ @use 'theme' as daff-theme; @mixin daffio-sub-footer-theme($theme) { - $secondary: map.get($theme, secondary); + $secondary: daff-theme.daff-map-get($theme, secondary); .daffio-sub-footer { background: linear-gradient( diff --git a/apps/daffio/src/app/core/header/components/header/header-theme.scss b/apps/daffio/src/app/core/header/components/header/header-theme.scss index eeffeac095..d3a85f2bb9 100644 --- a/apps/daffio/src/app/core/header/components/header/header-theme.scss +++ b/apps/daffio/src/app/core/header/components/header/header-theme.scss @@ -2,7 +2,7 @@ @use 'theme' as daff-theme; @mixin daffio-header-theme($theme) { - $primary: map.get($theme, primary); + $primary: daff-theme.daff-map-get($theme, primary); .daffio-header-item { &.active { diff --git a/apps/daffio/src/app/core/sidebar/components/sidebar-footer/sidebar-footer-theme.scss b/apps/daffio/src/app/core/sidebar/components/sidebar-footer/sidebar-footer-theme.scss index 04330c1548..4962e2f97b 100644 --- a/apps/daffio/src/app/core/sidebar/components/sidebar-footer/sidebar-footer-theme.scss +++ b/apps/daffio/src/app/core/sidebar/components/sidebar-footer/sidebar-footer-theme.scss @@ -5,7 +5,7 @@ $neutral: daff-theme.daff-map-get($theme, 'core', 'neutral'); $base: daff-theme.daff-map-get($theme, 'core', 'base'); $base-contrast: daff-theme.daff-map-get($theme, 'core', 'base-contrast'); - $primary: map.get($theme, primary); + $primary: daff-theme.daff-map-get($theme, primary); .daffio-sidebar-footer { background: daff-theme.daff-illuminate($base, $neutral, 2); diff --git a/apps/daffio/src/scss/type-descriptors/_mixins.scss b/apps/daffio/src/scss/type-descriptors/_mixins.scss index 4305c73122..ef8664494e 100644 --- a/apps/daffio/src/scss/type-descriptors/_mixins.scss +++ b/apps/daffio/src/scss/type-descriptors/_mixins.scss @@ -3,9 +3,9 @@ @use 'utilities' as daff; // stylelint-disable selector-class-pattern -$primary: map.get(daff-theme.$theme, primary); -$secondary: map.get(daff-theme.$theme, secondary); -$tertiary: map.get(daff-theme.$theme, tertiary); +$primary: daff-theme.daff-map-get(daff-theme.$theme, primary); +$secondary: daff-theme.daff-map-get(daff-theme.$theme, secondary); +$tertiary: daff-theme.daff-map-get(daff-theme.$theme, tertiary); $base: daff-theme.daff-map-get(daff-theme.$theme, 'core', 'base'); $base-contrast: daff-theme.daff-map-get( daff-theme.$theme, @@ -39,18 +39,26 @@ $base-contrast: daff-theme.daff-map-get( } &.const { - @include type-theming(daff-theme.daff-illuminate($base-contrast, $secondary, 3)); + @include type-theming( + daff-theme.daff-illuminate($base-contrast, $secondary, 3) + ); } &.enum { - @include type-theming(daff-theme.daff-illuminate($base-contrast, $primary, 3)); + @include type-theming( + daff-theme.daff-illuminate($base-contrast, $primary, 3) + ); } &.package { - @include type-theming(daff-theme.daff-illuminate($base-contrast, daff-theme.$daff-yellow, 3)); + @include type-theming( + daff-theme.daff-illuminate($base-contrast, daff-theme.$daff-yellow, 3) + ); } &.function { - @include type-theming(daff-theme.daff-illuminate($base-contrast, $tertiary, 3)); + @include type-theming( + daff-theme.daff-illuminate($base-contrast, $tertiary, 3) + ); } } diff --git a/apps/design-land/src/app/core/code-preview/component/code-preview-theme.scss b/apps/design-land/src/app/core/code-preview/component/code-preview-theme.scss index 82a7274c7a..2f33b16f9c 100644 --- a/apps/design-land/src/app/core/code-preview/component/code-preview-theme.scss +++ b/apps/design-land/src/app/core/code-preview/component/code-preview-theme.scss @@ -4,7 +4,7 @@ @mixin code-preview-theme($theme) { $neutral: daff-theme.daff-map-get($theme, 'core', 'neutral'); $base: daff-theme.daff-map-get($theme, 'core', 'base'); - $primary: map.get(daff-theme.$theme, primary); + $primary: daff-theme.daff-map-get(daff-theme.$theme, primary); $font-color: daff-theme.daff-map-get($theme, 'core', 'font-color'); $border: 1px solid daff-theme.daff-illuminate($base, $neutral, 2); diff --git a/apps/design-land/src/app/core/sidebar-viewport/sidebar-viewport-theme.scss b/apps/design-land/src/app/core/sidebar-viewport/sidebar-viewport-theme.scss index 6b4d025943..07bc261cab 100644 --- a/apps/design-land/src/app/core/sidebar-viewport/sidebar-viewport-theme.scss +++ b/apps/design-land/src/app/core/sidebar-viewport/sidebar-viewport-theme.scss @@ -5,7 +5,7 @@ $neutral: daff-theme.daff-map-get($theme, 'core', 'neutral'); $base: daff-theme.daff-map-get($theme, 'core', 'base'); $base-contrast: daff-theme.daff-map-get($theme, 'core', 'base-contrast'); - $primary: map.get($theme, primary); + $primary: daff-theme.daff-map-get($theme, primary); .design-land-sidebar-viewport { &__sidebar { diff --git a/libs/design/article/src/article-theme.scss b/libs/design/article/src/article-theme.scss index 9daad7b3dc..14fd52130f 100644 --- a/libs/design/article/src/article-theme.scss +++ b/libs/design/article/src/article-theme.scss @@ -4,9 +4,9 @@ @use '../../scss/theming'; @mixin daff-article-theme($theme) { - $primary: map.get($theme, primary); - $secondary: map.get($theme, secondary); - $tertiary: map.get($theme, tertiary); + $primary: core.daff-map-get($theme, primary); + $secondary: core.daff-map-get($theme, secondary); + $tertiary: core.daff-map-get($theme, tertiary); $base: core.daff-map-get($theme, 'core', 'base'); $base-contrast: core.daff-map-get($theme, 'core', 'base-contrast'); $white: core.daff-map-get($theme, 'core', 'white'); diff --git a/libs/design/button/src/button/basic/button-theme.scss b/libs/design/button/src/button/basic/button-theme.scss index 18ea4d40f1..fb846c4cbf 100644 --- a/libs/design/button/src/button/basic/button-theme.scss +++ b/libs/design/button/src/button/basic/button-theme.scss @@ -28,13 +28,13 @@ } @mixin daff-button-theme($theme) { - $primary: map.get($theme, primary); - $secondary: map.get($theme, secondary); - $tertiary: map.get($theme, tertiary); - $info: map.get($theme, info); - $warn: map.get($theme, warn); - $critical: map.get($theme, critical); - $success: map.get($theme, success); + $primary: core.daff-map-get($theme, primary); + $secondary: core.daff-map-get($theme, secondary); + $tertiary: core.daff-map-get($theme, tertiary); + $info: core.daff-map-get($theme, informational); + $warn: core.daff-map-get($theme, warn); + $critical: core.daff-map-get($theme, critical); + $success: core.daff-map-get($theme, success); $base: core.daff-map-get($theme, 'core', 'base'); $base-contrast: core.daff-map-get($theme, 'core', 'base-contrast'); $white: core.daff-map-get($theme, 'core', 'white'); diff --git a/libs/design/button/src/button/flat/flat-theme.scss b/libs/design/button/src/button/flat/flat-theme.scss index fb1d567403..9da269e4a0 100644 --- a/libs/design/button/src/button/flat/flat-theme.scss +++ b/libs/design/button/src/button/flat/flat-theme.scss @@ -23,13 +23,13 @@ } @mixin daff-flat-button-theme($theme) { - $primary: map.get($theme, primary); - $secondary: map.get($theme, secondary); - $tertiary: map.get($theme, tertiary); - $info: map.get($theme, info); - $warn: map.get($theme, warn); - $critical: map.get($theme, critical); - $success: map.get($theme, success); + $primary: core.daff-map-get($theme, primary); + $secondary: core.daff-map-get($theme, secondary); + $tertiary: core.daff-map-get($theme, tertiary); + $info: core.daff-map-get($theme, informational); + $warn: core.daff-map-get($theme, warn); + $critical: core.daff-map-get($theme, critical); + $success: core.daff-map-get($theme, success); $base: core.daff-map-get($theme, 'core', 'base'); $base-contrast: core.daff-map-get($theme, 'core', 'base-contrast'); $white: core.daff-map-get($theme, 'core', 'white'); diff --git a/libs/design/button/src/button/icon/icon-theme.scss b/libs/design/button/src/button/icon/icon-theme.scss index 759661ae3a..2d0feea428 100644 --- a/libs/design/button/src/button/icon/icon-theme.scss +++ b/libs/design/button/src/button/icon/icon-theme.scss @@ -24,13 +24,13 @@ } @mixin daff-icon-button-theme($theme) { - $primary: map.get($theme, primary); - $secondary: map.get($theme, secondary); - $tertiary: map.get($theme, tertiary); - $info: map.get($theme, info); - $warn: map.get($theme, warn); - $critical: map.get($theme, critical); - $success: map.get($theme, success); + $primary: core.daff-map-get($theme, primary); + $secondary: core.daff-map-get($theme, secondary); + $tertiary: core.daff-map-get($theme, tertiary); + $info: core.daff-map-get($theme, informational); + $warn: core.daff-map-get($theme, warn); + $critical: core.daff-map-get($theme, critical); + $success: core.daff-map-get($theme, success); $base: core.daff-map-get($theme, 'core', 'base'); $base-contrast: core.daff-map-get($theme, 'core', 'base-contrast'); $white: core.daff-map-get($theme, 'core', 'white'); diff --git a/libs/design/button/src/button/raised/raised-theme.scss b/libs/design/button/src/button/raised/raised-theme.scss index 1f7e0d08b3..c48dcf8a9a 100644 --- a/libs/design/button/src/button/raised/raised-theme.scss +++ b/libs/design/button/src/button/raised/raised-theme.scss @@ -34,13 +34,13 @@ } @mixin daff-raised-button-theme($theme) { - $primary: map.get($theme, primary); - $secondary: map.get($theme, secondary); - $tertiary: map.get($theme, tertiary); - $info: map.get($theme, info); - $warn: map.get($theme, warn); - $critical: map.get($theme, critical); - $success: map.get($theme, success); + $primary: core.daff-map-get($theme, primary); + $secondary: core.daff-map-get($theme, secondary); + $tertiary: core.daff-map-get($theme, tertiary); + $info: core.daff-map-get($theme, informational); + $warn: core.daff-map-get($theme, warn); + $critical: core.daff-map-get($theme, critical); + $success: core.daff-map-get($theme, success); $base: core.daff-map-get($theme, 'core', 'base'); $base-contrast: core.daff-map-get($theme, 'core', 'base-contrast'); $white: core.daff-map-get($theme, 'core', 'white'); diff --git a/libs/design/button/src/button/stroked/stroked-theme.scss b/libs/design/button/src/button/stroked/stroked-theme.scss index 449ebc1c9b..c2a68a7ec3 100644 --- a/libs/design/button/src/button/stroked/stroked-theme.scss +++ b/libs/design/button/src/button/stroked/stroked-theme.scss @@ -26,13 +26,13 @@ } @mixin daff-stroked-button-theme($theme) { - $primary: map.get($theme, primary); - $secondary: map.get($theme, secondary); - $tertiary: map.get($theme, tertiary); - $info: map.get($theme, info); - $warn: map.get($theme, warn); - $critical: map.get($theme, critical); - $success: map.get($theme, success); + $primary: core.daff-map-get($theme, primary); + $secondary: core.daff-map-get($theme, secondary); + $tertiary: core.daff-map-get($theme, tertiary); + $info: core.daff-map-get($theme, informational); + $warn: core.daff-map-get($theme, warn); + $critical: core.daff-map-get($theme, critical); + $success: core.daff-map-get($theme, success); $base: core.daff-map-get($theme, 'core', 'base'); $base-contrast: core.daff-map-get($theme, 'core', 'base-contrast'); $white: core.daff-map-get($theme, 'core', 'white'); diff --git a/libs/design/button/src/button/underline/underline-theme.scss b/libs/design/button/src/button/underline/underline-theme.scss index 720af9cb77..0506248f18 100644 --- a/libs/design/button/src/button/underline/underline-theme.scss +++ b/libs/design/button/src/button/underline/underline-theme.scss @@ -11,13 +11,13 @@ } @mixin daff-underline-button-theme($theme) { - $primary: map.get($theme, primary); - $secondary: map.get($theme, secondary); - $tertiary: map.get($theme, tertiary); - $info: map.get($theme, info); - $warn: map.get($theme, warn); - $critical: map.get($theme, critical); - $success: map.get($theme, success); + $primary: core.daff-map-get($theme, primary); + $secondary: core.daff-map-get($theme, secondary); + $tertiary: core.daff-map-get($theme, tertiary); + $info: core.daff-map-get($theme, informational); + $warn: core.daff-map-get($theme, warn); + $critical: core.daff-map-get($theme, critical); + $success: core.daff-map-get($theme, success); $base: core.daff-map-get($theme, 'core', 'base'); $base-contrast: core.daff-map-get($theme, 'core', 'base-contrast'); $white: core.daff-map-get($theme, 'core', 'white'); diff --git a/libs/design/callout/src/callout-theme.scss b/libs/design/callout/src/callout-theme.scss index 3b0dbd6baa..f67c6bc6ab 100644 --- a/libs/design/callout/src/callout-theme.scss +++ b/libs/design/callout/src/callout-theme.scss @@ -8,9 +8,9 @@ } @mixin daff-callout-theme($theme) { - $primary: map.get($theme, primary); - $secondary: map.get($theme, secondary); - $tertiary: map.get($theme, tertiary); + $primary: core.daff-map-get($theme, primary); + $secondary: core.daff-map-get($theme, secondary); + $tertiary: core.daff-map-get($theme, tertiary); $neutral: core.daff-map-get($theme, 'core', 'neutral'); $base: core.daff-map-get($theme, 'core', 'base'); $base-contrast: core.daff-map-get($theme, 'core', 'base-contrast'); diff --git a/libs/design/card/src/card-theme.scss b/libs/design/card/src/card-theme.scss index 32be481fc5..a9b9eeeacd 100644 --- a/libs/design/card/src/card-theme.scss +++ b/libs/design/card/src/card-theme.scss @@ -6,9 +6,9 @@ @use './card-theme-variants/linkable-card' as linkable; @mixin daff-card-theme($theme) { - $primary: map.get($theme, primary); - $secondary: map.get($theme, secondary); - $tertiary: map.get($theme, tertiary); + $primary: core.daff-map-get($theme, primary); + $secondary: core.daff-map-get($theme, secondary); + $tertiary: core.daff-map-get($theme, tertiary); $base: core.daff-map-get($theme, 'core', 'base'); $base-contrast: core.daff-map-get($theme, 'core', 'base-contrast'); $white: core.daff-map-get($theme, 'core', 'white'); diff --git a/libs/design/hero/src/hero-theme.scss b/libs/design/hero/src/hero-theme.scss index ff45a09c8a..15fcce9df0 100644 --- a/libs/design/hero/src/hero-theme.scss +++ b/libs/design/hero/src/hero-theme.scss @@ -8,9 +8,9 @@ } @mixin daff-hero-theme($theme) { - $primary: map.get($theme, primary); - $secondary: map.get($theme, secondary); - $tertiary: map.get($theme, tertiary); + $primary: core.daff-map-get($theme, primary); + $secondary: core.daff-map-get($theme, secondary); + $tertiary: core.daff-map-get($theme, tertiary); $neutral: core.daff-map-get($theme, 'core', 'neutral'); $base: core.daff-map-get($theme, 'core', 'base'); $base-contrast: core.daff-map-get($theme, 'core', 'base-contrast'); diff --git a/libs/design/loading-icon/src/loading-icon-theme.scss b/libs/design/loading-icon/src/loading-icon-theme.scss index 1367586e8f..a50f9f2006 100644 --- a/libs/design/loading-icon/src/loading-icon-theme.scss +++ b/libs/design/loading-icon/src/loading-icon-theme.scss @@ -3,9 +3,9 @@ @use '../../scss/theming'; @mixin daff-loading-icon-theme($theme) { - $primary: map.get($theme, primary); - $secondary: map.get($theme, secondary); - $tertiary: map.get($theme, tertiary); + $primary: core.daff-map-get($theme, primary); + $secondary: core.daff-map-get($theme, secondary); + $tertiary: core.daff-map-get($theme, tertiary); $base: core.daff-map-get($theme, 'core', 'base'); $base-contrast: core.daff-map-get($theme, 'core', 'base-contrast'); $white: core.daff-map-get($theme, 'core', 'white'); diff --git a/libs/design/navbar/src/navbar-theme.scss b/libs/design/navbar/src/navbar-theme.scss index bd72baa6f9..596290318e 100644 --- a/libs/design/navbar/src/navbar-theme.scss +++ b/libs/design/navbar/src/navbar-theme.scss @@ -8,9 +8,9 @@ } @mixin daff-navbar-theme($theme) { - $primary: map.get($theme, primary); - $secondary: map.get($theme, secondary); - $tertiary: map.get($theme, tertiary); + $primary: core.daff-map-get($theme, primary); + $secondary: core.daff-map-get($theme, secondary); + $tertiary: core.daff-map-get($theme, tertiary); $neutral: core.daff-map-get($theme, 'core', 'neutral'); $base: core.daff-map-get($theme, 'core', 'base'); $base-contrast: core.daff-map-get($theme, 'core', 'base-contrast'); diff --git a/libs/design/notification/src/notification-theme.scss b/libs/design/notification/src/notification-theme.scss index 86054cc94d..76015b181c 100644 --- a/libs/design/notification/src/notification-theme.scss +++ b/libs/design/notification/src/notification-theme.scss @@ -3,13 +3,13 @@ @use '../../scss/theming'; @mixin daff-notification-theme($theme) { - $primary: map.get($theme, primary); - $secondary: map.get($theme, secondary); - $tertiary: map.get($theme, tertiary); - $info: map.get($theme, info); - $warn: map.get($theme, warn); - $critical: map.get($theme, critical); - $success: map.get($theme, success); + $primary: core.daff-map-get($theme, primary); + $secondary: core.daff-map-get($theme, secondary); + $tertiary: core.daff-map-get($theme, tertiary); + $info: core.daff-map-get($theme, informational); + $warn: core.daff-map-get($theme, warn); + $critical: core.daff-map-get($theme, critical); + $success: core.daff-map-get($theme, success); $neutral: core.daff-map-get($theme, 'core', 'neutral'); $base: core.daff-map-get($theme, 'core', 'base'); $base-contrast: core.daff-map-get($theme, 'core', 'base-contrast'); diff --git a/libs/design/paginator/src/paginator-theme.scss b/libs/design/paginator/src/paginator-theme.scss index c910461a2f..304db0e89f 100644 --- a/libs/design/paginator/src/paginator-theme.scss +++ b/libs/design/paginator/src/paginator-theme.scss @@ -3,9 +3,9 @@ @use '../../scss/theming'; @mixin daff-paginator-theme($theme) { - $primary: map.get($theme, primary); - $secondary: map.get($theme, secondary); - $tertiary: map.get($theme, tertiary); + $primary: core.daff-map-get($theme, primary); + $secondary: core.daff-map-get($theme, secondary); + $tertiary: core.daff-map-get($theme, tertiary); $base: core.daff-map-get($theme, 'core', 'base'); $base-contrast: core.daff-map-get($theme, 'core', 'base-contrast'); $white: core.daff-map-get($theme, 'core', 'white'); diff --git a/libs/design/progress-bar/src/progress-bar-theme.scss b/libs/design/progress-bar/src/progress-bar-theme.scss index 469563a34f..14763387c5 100644 --- a/libs/design/progress-bar/src/progress-bar-theme.scss +++ b/libs/design/progress-bar/src/progress-bar-theme.scss @@ -3,9 +3,9 @@ @use '../../scss/theming'; @mixin daff-progress-bar-theme($theme) { - $primary: map.get($theme, primary); - $secondary: map.get($theme, secondary); - $tertiary: map.get($theme, tertiary); + $primary: core.daff-map-get($theme, primary); + $secondary: core.daff-map-get($theme, secondary); + $tertiary: core.daff-map-get($theme, tertiary); $base: core.daff-map-get($theme, 'core', 'base'); $base-contrast: core.daff-map-get($theme, 'core', 'base-contrast'); $white: core.daff-map-get($theme, 'core', 'white'); diff --git a/libs/design/scss/theming/_theme-css-variables.scss b/libs/design/scss/theming/_theme-css-variables.scss index c7c61bfb26..ce14d85de7 100644 --- a/libs/design/scss/theming/_theme-css-variables.scss +++ b/libs/design/scss/theming/_theme-css-variables.scss @@ -9,9 +9,9 @@ @mixin daff-root-theme-tokens($theme) { $base: core.daff-map-get($theme, 'core', 'base'); $base-contrast: core.daff-map-get($theme, 'core', 'base-contrast'); - $primary: map.get($theme, primary); - $secondary: map.get($theme, secondary); - $tertiary: map.get($theme, tertiary); + $primary: core.daff-map-get($theme, primary); + $secondary: core.daff-map-get($theme, secondary); + $tertiary: core.daff-map-get($theme, tertiary); $neutral: core.daff-map-get($theme, 'core', 'neutral'); $white: core.daff-map-get($theme, 'core', 'white'); $black: core.daff-map-get($theme, 'core', 'black'); diff --git a/libs/design/src/atoms/form/form-field/form-field/form-field-theme.scss b/libs/design/src/atoms/form/form-field/form-field/form-field-theme.scss index 9ed63347f5..4a11e8002a 100644 --- a/libs/design/src/atoms/form/form-field/form-field/form-field-theme.scss +++ b/libs/design/src/atoms/form/form-field/form-field/form-field-theme.scss @@ -3,9 +3,9 @@ @use '../../../../../scss/theming'; @mixin daff-form-field-theme($theme) { - $primary: map.get($theme, primary); - $secondary: map.get($theme, secondary); - $tertiary: map.get($theme, tertiary); + $primary: core.daff-map-get($theme, primary); + $secondary: core.daff-map-get($theme, secondary); + $tertiary: core.daff-map-get($theme, tertiary); $base: core.daff-map-get($theme, 'core', 'base'); $base-contrast: core.daff-map-get($theme, 'core', 'base-contrast'); $neutral: core.daff-map-get($theme, 'core', 'neutral'); diff --git a/libs/design/tabs/src/tabs-theme.scss b/libs/design/tabs/src/tabs-theme.scss index 326ac64d2e..780aec9e48 100644 --- a/libs/design/tabs/src/tabs-theme.scss +++ b/libs/design/tabs/src/tabs-theme.scss @@ -3,9 +3,9 @@ @use '../../scss/theming'; @mixin daff-tabs-theme($theme) { - $primary: map.get($theme, primary); - $secondary: map.get($theme, secondary); - $tertiary: map.get($theme, tertiary); + $primary: core.daff-map-get($theme, primary); + $secondary: core.daff-map-get($theme, secondary); + $tertiary: core.daff-map-get($theme, tertiary); $neutral: core.daff-map-get($theme, 'core', 'neutral'); $base: core.daff-map-get($theme, 'core', 'base'); $base-contrast: core.daff-map-get($theme, 'core', 'base-contrast'); diff --git a/libs/design/toast/src/toast-theme.scss b/libs/design/toast/src/toast-theme.scss index 1c5cea8054..e88764b9b3 100644 --- a/libs/design/toast/src/toast-theme.scss +++ b/libs/design/toast/src/toast-theme.scss @@ -3,13 +3,13 @@ @use '../../scss/theming'; @mixin daff-toast-theme($theme) { - $primary: map.get($theme, primary); - $secondary: map.get($theme, secondary); - $tertiary: map.get($theme, tertiary); - $info: map.get($theme, info); - $warn: map.get($theme, warn); - $critical: map.get($theme, critical); - $success: map.get($theme, success); + $primary: core.daff-map-get($theme, primary); + $secondary: core.daff-map-get($theme, secondary); + $tertiary: core.daff-map-get($theme, tertiary); + $info: core.daff-map-get($theme, informational); + $warn: core.daff-map-get($theme, warn); + $critical: core.daff-map-get($theme, critical); + $success: core.daff-map-get($theme, success); $neutral: core.daff-map-get($theme, 'core', 'neutral'); $base: core.daff-map-get($theme, 'core', 'base'); $base-contrast: core.daff-map-get($theme, 'core', 'base-contrast'); diff --git a/libs/design/tree/src/tree-theme.scss b/libs/design/tree/src/tree-theme.scss index bca93d1a15..738c7e2a3a 100644 --- a/libs/design/tree/src/tree-theme.scss +++ b/libs/design/tree/src/tree-theme.scss @@ -3,9 +3,9 @@ @use '../../scss/core'; @mixin daff-tree-theme($theme) { - $primary: map.get($theme, primary); - $secondary: map.get($theme, secondary); - $tertiary: map.get($theme, tertiary); + $primary: core.daff-map-get($theme, primary); + $secondary: core.daff-map-get($theme, secondary); + $tertiary: core.daff-map-get($theme, tertiary); $base: core.daff-map-get($theme, 'core', 'base'); $base-contrast: core.daff-map-get($theme, 'core', 'base-contrast'); $white: core.daff-map-get($theme, 'core', 'white'); From c302ce754dd06955d6520c8a19cfe4b51af1b477 Mon Sep 17 00:00:00 2001 From: xelaint Date: Tue, 31 Dec 2024 09:48:38 -0500 Subject: [PATCH 8/9] update switch theme with correct values --- libs/design/switch/src/switch-theme.scss | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libs/design/switch/src/switch-theme.scss b/libs/design/switch/src/switch-theme.scss index 3438a260b5..b58c1159ab 100644 --- a/libs/design/switch/src/switch-theme.scss +++ b/libs/design/switch/src/switch-theme.scss @@ -3,12 +3,12 @@ @use '../../scss/theming'; @mixin daff-switch-theme($theme) { - $primary: map.get($theme, primary); - $base: core.daff-map-deep-get($theme, 'core.base'); - $base-contrast: core.daff-map-deep-get($theme, 'core.base-contrast'); - $white: core.daff-map-deep-get($theme, 'core.white'); - $black: core.daff-map-deep-get($theme, 'core.black'); - $neutral: core.daff-map-deep-get($theme, 'core.neutral'); + $primary: core.daff-map-get($theme, primary); + $base: core.daff-map-get($theme, 'core', 'base'); + $base-contrast: core.daff-map-get($theme, 'core', 'base-contrast'); + $white: core.daff-map-get($theme, 'core', 'white'); + $black: core.daff-map-get($theme, 'core', 'black'); + $neutral: core.daff-map-get($theme, 'core', 'neutral'); .daff-switch { &__toggle { From f9810a7be7e5c40185840c85ada975b12ac11940 Mon Sep 17 00:00:00 2001 From: xelaint Date: Tue, 31 Dec 2024 10:22:25 -0500 Subject: [PATCH 9/9] fix linting --- libs/design/list/src/list-theme.scss | 4 ++-- libs/design/scss/core/error/error-to-string.scss | 2 +- libs/design/scss/theming/_daff-theme.scss | 2 +- libs/design/toast/src/toast-theme.scss | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libs/design/list/src/list-theme.scss b/libs/design/list/src/list-theme.scss index 0415f87abf..3bf05cf7aa 100644 --- a/libs/design/list/src/list-theme.scss +++ b/libs/design/list/src/list-theme.scss @@ -11,13 +11,13 @@ .daff-list { .daff-list-item { &__content { + // stylelint-disable-next-line scss/selector-nest-combinators *:nth-child(1) { - /* stylelint-disable-line scss/selector-nest-combinators */ color: $base-contrast; } + // stylelint-disable-next-line scss/selector-nest-combinators *:nth-child(n + 2) { - /* stylelint-disable-line scss/selector-nest-combinators */ color: theming.daff-illuminate($base-contrast, $neutral, 3); } } diff --git a/libs/design/scss/core/error/error-to-string.scss b/libs/design/scss/core/error/error-to-string.scss index 13c2231509..84328e5579 100644 --- a/libs/design/scss/core/error/error-to-string.scss +++ b/libs/design/scss/core/error/error-to-string.scss @@ -10,4 +10,4 @@ $use-string: false !default; @mixin set-use-string($state: true) { $use-string: $state !global; -} \ No newline at end of file +} diff --git a/libs/design/scss/theming/_daff-theme.scss b/libs/design/scss/theming/_daff-theme.scss index f3a5f81e64..aa60e4c12f 100644 --- a/libs/design/scss/theming/_daff-theme.scss +++ b/libs/design/scss/theming/_daff-theme.scss @@ -26,4 +26,4 @@ $theme-dark: configure-theme.daff-configure-theme( ); $black: core.daff-map-get($theme, 'core', 'black'); -$white: core.daff-map-get($theme, 'core', 'white'); \ No newline at end of file +$white: core.daff-map-get($theme, 'core', 'white'); diff --git a/libs/design/toast/src/toast-theme.scss b/libs/design/toast/src/toast-theme.scss index e88764b9b3..92740b8943 100644 --- a/libs/design/toast/src/toast-theme.scss +++ b/libs/design/toast/src/toast-theme.scss @@ -33,7 +33,7 @@ color: theming.daff-color($success); } - &:before { + &::before { background: theming.daff-color($success); } }