Skip to content

Commit 3b4f164

Browse files
committed
refactor: another try
1 parent f114ce6 commit 3b4f164

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

packages/foundations/scss/defaults/default-required.scss

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,18 @@
3333
}
3434

3535
// We'll set the color scheme (https://developer.mozilla.org/en-US/docs/Web/CSS/color-scheme) to light and dark if it's not already set as a meta tag in the head, which would be the recommended way.
36-
:root:not(:has([name="color-scheme"])) {
37-
color-scheme: light dark;
36+
:root {
37+
color-scheme: var(--db-color-scheme, light dark);
38+
39+
&:has([name="color-scheme"][content="light dark"]) {
40+
--db-color-scheme: light dark;
41+
}
42+
&:has([name="color-scheme"][content="light"]) {
43+
--db-color-scheme: light;
44+
}
45+
&:has([name="color-scheme"][content="dark"]) {
46+
--db-color-scheme: dark;
47+
}
3848
}
3949

4050
/* TODO: Switch to attr() as soon as this one is fully supported */

0 commit comments

Comments
 (0)