Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(design): daff-map-get function #3358

Merged
merged 9 commits into from
Jan 2, 2025
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
@use 'theme' as daff-theme;

@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');
$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');

.daffio-feature-comparison {
background: $base;
Expand Down
8 changes: 4 additions & 4 deletions apps/daffio/src/app/core/footer/footer/footer-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
@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');
$secondary: map.get($theme, secondary);
$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: daff-theme.daff-map-get($theme, secondary);

.daffio-footer {
border-top: 1px solid daff-theme.daff-illuminate($base, $neutral, 2);
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,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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
@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');
$primary: map.get($theme, primary);
$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: daff-theme.daff-map-get($theme, primary);

.daffio-sidebar-footer {
background: daff-theme.daff-illuminate($base, $neutral, 2);
Expand Down
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');

.daffio-newsletter {
&__input {
Expand Down
30 changes: 21 additions & 9 deletions apps/daffio/src/scss/type-descriptors/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@
@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);
$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');
$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,
'core',
'base-contrast'
);

@mixin type-theming($color) {
background: $color;
Expand Down Expand Up @@ -35,18 +39,26 @@ $base-contrast: daff-theme.daff-map-deep-get(daff-theme.$theme, 'core.base-contr
}

&.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)
);
}
}
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');
$primary: map.get(daff-theme.$theme, primary);
$font-color: daff-theme.daff-map-deep-get($theme, 'core.font-color');
$neutral: daff-theme.daff-map-get($theme, 'core', 'neutral');
$base: daff-theme.daff-map-get($theme, 'core', 'base');
$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);

.design-land-code-preview {
Expand All @@ -28,4 +27,4 @@
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
@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');
$primary: map.get($theme, primary);
$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: daff-theme.daff-map-get($theme, primary);

.design-land-sidebar-viewport {
&__sidebar {
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
16 changes: 8 additions & 8 deletions libs/design/article/src/article-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
@use '../../scss/theming';

@mixin daff-article-theme($theme) {
$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');
$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');
$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
Loading
Loading