Skip to content

Commit 52b904c

Browse files
committed
https://github.com/elmsln/issues/issues/1939
1 parent 9151709 commit 52b904c

File tree

5 files changed

+16
-3
lines changed

5 files changed

+16
-3
lines changed

elements/clean-one/clean-one.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ class CleanOne extends PrintBranchMixin(
6060
-webkit-box-orient: vertical;
6161
-webkit-box-direction: normal;
6262
--ddd-theme-body-font-size: var(--ddd-font-size-xxs);
63-
background: white;
63+
background-color: light-dark(var(--ddd-accent-6), var(--ddd-primary-4));
64+
color: light-dark(black, var(--ddd-accent-6));
6465
--simple-tooltip-background: var(--ddd-theme-default-info);
6566
--simple-tooltip-text-color: var(--ddd-theme-default-infoLight);
6667
--simple-tooltip-opacity: 1;

elements/clean-one/src/clean-one.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ class CleanOne extends PrintBranchMixin(
6060
-webkit-box-orient: vertical;
6161
-webkit-box-direction: normal;
6262
--ddd-theme-body-font-size: var(--ddd-font-size-xxs);
63-
background: white;
63+
background-color: light-dark(var(--ddd-accent-6), var(--ddd-primary-4));
64+
color: light-dark(black, var(--ddd-accent-6));
6465
--simple-tooltip-background: var(--ddd-theme-default-info);
6566
--simple-tooltip-text-color: var(--ddd-theme-default-infoLight);
6667
--simple-tooltip-opacity: 1;

elements/d-d-d/lib/DDDStyles.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -563,6 +563,7 @@ export const DDDVariables = css`
563563
html,
564564
body,
565565
:host {
566+
color-scheme: light dark;
566567
/* base colors */
567568
--ddd-theme-default-beaverBlue: #1e407c;
568569
--ddd-theme-default-beaver70: rgba(30, 64, 124, 0.7);
@@ -984,6 +985,14 @@ export const DDDVariables = css`
984985
font-weight: var(--ddd-font-weight-regular);
985986
letter-spacing: normal;
986987
}
988+
/* basic dark mode support */
989+
body:not(.dark-mode) {
990+
color-scheme: only light;
991+
}
992+
993+
body.dark-mode {
994+
color-scheme: only dark;
995+
}
987996
`;
988997
/* Data Attributes used by HAX */
989998
export const DDDDataAttributes = [

elements/haxcms-elements/demo/site.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
}
3232
},
3333
"theme": {
34-
"element": "polaris-invent-theme",
34+
"element": "clean-one",
3535
"path": "@lrnwebcomponents/polaris-theme/lib/polaris-invent-theme.js",
3636
"name": "Polaris - Invent",
3737
"thumbnail": "build/es6/node_modules/@lrnwebcomponents/app-hax/lib/assets/images/PartyStyle.svg",

elements/haxcms-elements/lib/ui-components/navigation/site-menu.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ class SiteMenu extends HAXCMSThemeParts(LitElement) {
2222
css`
2323
:host {
2424
display: block;
25+
background-color: light-dark(var(--ddd-accent-6), var(--ddd-primary-4));
26+
color: light-dark(black, var(--ddd-accent-6));
2527
}
2628
map-menu {
2729
padding: var(--site-menu-padding);

0 commit comments

Comments
 (0)