Skip to content

Commit 7dcbca0

Browse files
authored
feat: add Aura theme attributes to switch between light and dark theme (#10486)
1 parent 982464c commit 7dcbca0

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

dev/aura.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@
416416
>
417417
<h3>Edit Theme</h3>
418418
<vaadin-checkbox label="Use Navbar" id="useNavbar"></vaadin-checkbox>
419-
<aura-scheme-control property="--aura-color-scheme" label="--aura-color-scheme"></aura-scheme-control>
419+
<aura-scheme-control property="color-scheme" label="color-scheme"></aura-scheme-control>
420420
<aura-scheme-control
421421
property="--aura-content-color-scheme"
422422
label="--aura-content-color-scheme"

packages/aura/src/color-scheme.css

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
:where(:root),
22
:where(:host) {
3-
--aura-color-scheme: light;
4-
--aura-content-color-scheme: var(--aura-color-scheme);
5-
--aura-notification-color-scheme: var(--aura-color-scheme);
3+
--aura-content-color-scheme: inherit;
4+
--aura-notification-color-scheme: inherit;
65
}
76

8-
html {
9-
color-scheme: var(--aura-color-scheme);
7+
[theme~='light'] {
8+
color-scheme: light;
9+
}
10+
11+
[theme~='dark'] {
12+
color-scheme: dark;
13+
}
14+
15+
[theme~='light-dark'] {
16+
color-scheme: light dark;
1017
}

0 commit comments

Comments
 (0)