@salesforcedevs/dx-components 1.3.384-alpha5 → 1.3.385-alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/modules/dx/audio/audio.css +2 -2
- package/src/modules/dx/darkModeManager/darkModeManager.ts +9 -0
- package/src/modules/dx/featuredContentHeader/featuredContentHeader.css +4 -5
- package/src/modules/dx/featuredContentHeader/featuredContentHeader.ts +2 -1
- package/src/modules/dx/podcastHost/podcastHost.css +1 -1
- package/src/modules/dx/toc/toc.ts +5 -1
- package/package-lock.json +0 -7980
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
--dx-c-audio-background-color: var(--dx-g-audio-background-color, #e0e5f8);
|
|
10
10
|
--dx-c-audio-inner-div-background-color: var(
|
|
11
11
|
--dx-g-audio-inner-div-background-color,
|
|
12
|
-
#
|
|
12
|
+
#fff
|
|
13
13
|
);
|
|
14
14
|
}
|
|
15
15
|
|
|
@@ -50,7 +50,7 @@ dx-icon {
|
|
|
50
50
|
--dx-c-popover-padding: 0;
|
|
51
51
|
|
|
52
52
|
align-items: center;
|
|
53
|
-
background-color: var(--dx-c-audio-inner-div-background-color
|
|
53
|
+
background-color: var(--dx-c-audio-inner-div-background-color);
|
|
54
54
|
border-radius: 5px;
|
|
55
55
|
display: flex;
|
|
56
56
|
margin-top: 8px;
|
|
@@ -42,6 +42,13 @@ export const getLocalStorageDarkModeSetting = () => {
|
|
|
42
42
|
return localStorage.getItem(LOCAL_STORAGE_KEY);
|
|
43
43
|
};
|
|
44
44
|
|
|
45
|
+
const isBrowserDarkModeEnabled = () => {
|
|
46
|
+
return (
|
|
47
|
+
window.matchMedia &&
|
|
48
|
+
window.matchMedia("(prefers-color-scheme: dark)").matches
|
|
49
|
+
);
|
|
50
|
+
};
|
|
51
|
+
|
|
45
52
|
export const setLocalStorageDarkModeSetting = (theme: string) => {
|
|
46
53
|
localStorage.setItem(LOCAL_STORAGE_KEY, theme);
|
|
47
54
|
};
|
|
@@ -57,6 +64,8 @@ export default class DarkModeManager extends LightningElement {
|
|
|
57
64
|
if (DARK_MODE_THEMES.includes(theme)) {
|
|
58
65
|
setTheme(theme);
|
|
59
66
|
}
|
|
67
|
+
} else if (isBrowserDarkModeEnabled()) {
|
|
68
|
+
setTheme("dark");
|
|
60
69
|
}
|
|
61
70
|
window.addEventListener(
|
|
62
71
|
DARKMODE_TOGGLE_EVENT_NAME,
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
|
|
37
37
|
.title-bar {
|
|
38
38
|
padding: 0 40px;
|
|
39
|
-
height: 100px;
|
|
39
|
+
min-height: 100px;
|
|
40
40
|
display: flex;
|
|
41
41
|
align-items: center;
|
|
42
42
|
justify-content: space-between;
|
|
@@ -46,17 +46,16 @@
|
|
|
46
46
|
|
|
47
47
|
@media screen and (max-width: 500px) {
|
|
48
48
|
.title-bar {
|
|
49
|
-
padding:
|
|
50
|
-
height: 125px;
|
|
49
|
+
padding: 16px 30px;
|
|
50
|
+
min-height: 125px;
|
|
51
51
|
display: block;
|
|
52
52
|
align-items: center;
|
|
53
53
|
justify-content: space-between;
|
|
54
54
|
box-shadow: 0 0 0 2px #0003;
|
|
55
55
|
color: var(--label-color);
|
|
56
|
-
padding-top: 16px;
|
|
57
56
|
}
|
|
58
57
|
|
|
59
|
-
.right-div {
|
|
58
|
+
.title-bar > .right-div {
|
|
60
59
|
margin-top: 10px;
|
|
61
60
|
}
|
|
62
61
|
}
|
|
@@ -41,6 +41,7 @@ export default class FeaturedContentHeader extends LightningElement {
|
|
|
41
41
|
@api dark: boolean = false;
|
|
42
42
|
@api icon: string = "";
|
|
43
43
|
@api swoopUnderColor: string = "var(--dx-g-fch-swoop-under-color)";
|
|
44
|
+
@api enableDarkModeToggle: boolean = false;
|
|
44
45
|
|
|
45
46
|
private _authors?: Array<ImageAndLabel>;
|
|
46
47
|
private isSlotEmpty: boolean = true;
|
|
@@ -94,7 +95,7 @@ export default class FeaturedContentHeader extends LightningElement {
|
|
|
94
95
|
}
|
|
95
96
|
|
|
96
97
|
private get isDarkModeEnabled() {
|
|
97
|
-
return isDarkModeEnabled();
|
|
98
|
+
return this.enableDarkModeToggle && isDarkModeEnabled();
|
|
98
99
|
}
|
|
99
100
|
|
|
100
101
|
private get hasPlainImage() {
|
|
@@ -45,7 +45,11 @@ export default class Toc extends LightningElement {
|
|
|
45
45
|
const href = target.getAttribute("href");
|
|
46
46
|
|
|
47
47
|
this.dispatchEvent(
|
|
48
|
-
new CustomEvent("selectedcontent", {
|
|
48
|
+
new CustomEvent("selectedcontent", {
|
|
49
|
+
detail: { name: id },
|
|
50
|
+
bubbles: true,
|
|
51
|
+
composed: true
|
|
52
|
+
})
|
|
49
53
|
);
|
|
50
54
|
|
|
51
55
|
this._value = id!;
|