Skip to content

Commit

Permalink
feat(design): replace daff-map-deep-get with daff-map-get
Browse files Browse the repository at this point in the history
  • Loading branch information
gracetxgao committed Dec 13, 2024
1 parent f8fab1e commit 4adf2ce
Show file tree
Hide file tree
Showing 55 changed files with 240 additions and 368 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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');

.feature-comparison {
background: $base;
Expand Down
6 changes: 3 additions & 3 deletions apps/daffio/src/app/core/footer/footer/footer-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
@@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -14,4 +14,4 @@
background: daff-theme.daff-illuminate($base, $neutral, 3);
}
}
}
}
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions apps/daffio/src/app/newsletter/newsletter-theme.scss
Original file line number Diff line number Diff line change
@@ -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');

.newsletter {
&__input {
Expand Down
8 changes: 6 additions & 2 deletions apps/daffio/src/scss/type-descriptors/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,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;
Expand Down
6 changes: 3 additions & 3 deletions apps/demo/src/scss/demo-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -28,4 +27,4 @@
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -25,4 +25,4 @@
color: $base;
}
}
}
}
10 changes: 5 additions & 5 deletions apps/design-land/src/app/foundations/color/color-theme.scss
Original file line number Diff line number Diff line change
@@ -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;
}
Expand Down
8 changes: 4 additions & 4 deletions apps/design-land/src/app/typography/typography-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
}
}
6 changes: 3 additions & 3 deletions libs/branding/src/lib/logo/logo-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions libs/branding/src/scss/branding-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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');
4 changes: 2 additions & 2 deletions libs/design/accordion/src/accordion-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
10 changes: 5 additions & 5 deletions libs/design/article/src/article-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions libs/design/breadcrumb/src/breadcrumb-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
10 changes: 5 additions & 5 deletions libs/design/button/src/button/basic/button-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
19 changes: 9 additions & 10 deletions libs/design/button/src/button/flat/flat-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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;
Expand All @@ -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 {
Expand Down
13 changes: 6 additions & 7 deletions libs/design/button/src/button/icon/icon-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
color: $hover-color;
@if $base-color == currentColor {
opacity: 0.8;
}
@else {
} @else {
opacity: 1;
}
}
Expand All @@ -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(
Expand Down
Loading

0 comments on commit 4adf2ce

Please sign in to comment.