Skip to content

Commit 87cbcc5

Browse files
committed
add hardcoded theme-color fallback for old browsers
1 parent d765f15 commit 87cbcc5

File tree

3 files changed

+31
-5
lines changed

3 files changed

+31
-5
lines changed

site/_includes/partials/header.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@
6060
</ul>
6161
</div>
6262
<!-- end big menu -->
63-
<label aria-label="light/dark mode toggle switch" class="cursor-pointer grid place-items-center">
64-
<input id="toggle-darkmode" type="checkbox" value="dark" class="toggle theme-controller bg-base-content row-start-1 col-start-1 col-span-2"/>
63+
<label id="toggle-darkmode" aria-label="light/dark mode toggle switch" class="cursor-pointer grid place-items-center">
64+
<input type="checkbox" value="dark" class="toggle theme-controller bg-base-content row-start-1 col-start-1 col-span-2"/>
6565
<svg class="col-start-1 row-start-1 stroke-base-100 fill-base-100" xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
6666
<circle cx="12" cy="12" r="5"/>
6767
<path d="M12 1v2M12 21v2M4.2 4.2l1.4 1.4M18.4 18.4l1.4 1.4M1 12h2M21 12h2M4.2 19.8l1.4-1.4M18.4 5.6l1.4-1.4"/>

site/css/styles.css

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,29 @@ details[open] > summary.meta-summary::before {
7373
.flickity-button:focus {
7474
box-shadow: none !important;
7575
}
76+
77+
@supports not (color: oklch(0% 0 0)) { */
78+
#toggle-darkmode {
79+
display: none !important;
80+
}
81+
:root {
82+
color-scheme: light;
83+
--fallback-s: #975020;
84+
--fallback-a: #007049;
85+
--fallback-n: #EAE0CD;
86+
--fallback-nc: #230616;
87+
--fallback-bc: #230616;
88+
--fallback-b1: #f5f0e6;
89+
}
90+
@media (prefers-color-scheme: dark) {
91+
:root {
92+
color-scheme: dark;
93+
--fallback-s: #C2845B;
94+
--fallback-a: #61A88F;
95+
--fallback-n: #33272e;
96+
--fallback-nc: #e8e3da;
97+
--fallback-bc: #E7DBC5;
98+
--fallback-b1: #11030B;
99+
}
100+
}
101+
}

tailwind.config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ module.exports = {
1515
{
1616
light: {
1717
...require("daisyui/src/theming/themes")["light"],
18-
"base-100": "#f5f0e6", /* alabaster */
18+
"base-100": "#f5f0e6", // alabaster
1919
"base-content": "#230616", // dark purple
20-
"accent": "#007049", // dartmouth green "#007A50", // dark spring green
20+
"accent": "#007049", // dartmouth green
2121
"secondary": "#975020", // brown sugar
2222
"neutral": "#EAE0CD", // pearl
2323
"neutral-content": "#230616" // dark purple
@@ -31,7 +31,7 @@ module.exports = {
3131
"accent": "#61A88F", // zomp
3232
"secondary": "#C2845B", // brown sugar
3333
"neutral": "#33272e", // raisin black
34-
"neutral-content": "#F3EDE2", // alabaster
34+
"neutral-content": "#e8e3da" // alabaster
3535
},
3636
},
3737
],

0 commit comments

Comments
 (0)