Skip to content

Commit b1e05c5

Browse files
Bikram GoleBikram Gole
authored andcommitted
Keep root theme in sync and fix bottom theme mismatch
1 parent a1cac1b commit b1e05c5

5 files changed

Lines changed: 18 additions & 1 deletion

File tree

about.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
const savedTheme = window.localStorage.getItem(themeKey);
2525
const selected = validThemes.has(savedTheme) ? savedTheme : (validThemes.has(urlTheme) ? urlTheme : null);
2626
if (selected) {
27+
document.documentElement.dataset.theme = selected;
2728
document.body.dataset.theme = selected;
2829
if (selected !== savedTheme) {
2930
window.localStorage.setItem(themeKey, selected);

contact.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
const savedTheme = window.localStorage.getItem(themeKey);
2525
const selected = validThemes.has(savedTheme) ? savedTheme : (validThemes.has(urlTheme) ? urlTheme : null);
2626
if (selected) {
27+
document.documentElement.dataset.theme = selected;
2728
document.body.dataset.theme = selected;
2829
if (selected !== savedTheme) {
2930
window.localStorage.setItem(themeKey, selected);

index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
const savedTheme = window.localStorage.getItem(themeKey);
2525
const selected = validThemes.has(savedTheme) ? savedTheme : (validThemes.has(urlTheme) ? urlTheme : null);
2626
if (selected) {
27+
document.documentElement.dataset.theme = selected;
2728
document.body.dataset.theme = selected;
2829
if (selected !== savedTheme) {
2930
window.localStorage.setItem(themeKey, selected);

script.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -677,6 +677,7 @@ function initPenguinDateBadge() {
677677
function applyTheme(theme, notify = false) {
678678
const selected = THEME_OPTIONS.includes(theme) ? theme : "neo";
679679
currentTheme = selected;
680+
document.documentElement.dataset.theme = selected;
680681
document.body.dataset.theme = selected;
681682
if (headerThemeSelect) headerThemeSelect.value = selected;
682683
if (heroName) {

styles.css

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ html {
2626
linear-gradient(160deg, var(--bg-0), var(--bg-1) 45%, var(--bg-2));
2727
}
2828

29+
:root[data-theme="mint"],
2930
body[data-theme="mint"] {
3031
--blue: #66ffcd;
3132
--blue-2: #b5ffe8;
@@ -34,6 +35,7 @@ body[data-theme="mint"] {
3435
--border: rgba(101, 229, 190, 0.44);
3536
}
3637

38+
:root[data-theme="sunset"],
3739
body[data-theme="sunset"] {
3840
--blue: #ffa764;
3941
--blue-2: #ffd0ac;
@@ -42,6 +44,7 @@ body[data-theme="sunset"] {
4244
--border: rgba(242, 132, 108, 0.45);
4345
}
4446

47+
:root[data-theme="midnight"],
4548
body[data-theme="midnight"] {
4649
--bg-0: #010208;
4750
--bg-1: #050b1a;
@@ -57,6 +60,7 @@ body[data-theme="midnight"] {
5760
--header: rgba(3, 7, 18, 0.92);
5861
}
5962

63+
:root[data-theme="ember"],
6064
body[data-theme="ember"] {
6165
--bg-0: #120805;
6266
--bg-1: #23110a;
@@ -72,6 +76,7 @@ body[data-theme="ember"] {
7276
--header: rgba(25, 11, 8, 0.9);
7377
}
7478

79+
:root[data-theme="arctic"],
7580
body[data-theme="arctic"] {
7681
--bg-0: #041217;
7782
--bg-1: #0b2129;
@@ -87,6 +92,7 @@ body[data-theme="arctic"] {
8792
--header: rgba(6, 18, 24, 0.92);
8893
}
8994

95+
:root[data-theme="grape"],
9096
body[data-theme="grape"] {
9197
--bg-0: #12051a;
9298
--bg-1: #1f0d2a;
@@ -102,6 +108,7 @@ body[data-theme="grape"] {
102108
--header: rgba(18, 9, 26, 0.92);
103109
}
104110

111+
:root[data-theme="toxic"],
105112
body[data-theme="toxic"] {
106113
--bg-0: #090f04;
107114
--bg-1: #121c08;
@@ -117,6 +124,7 @@ body[data-theme="toxic"] {
117124
--header: rgba(12, 18, 8, 0.92);
118125
}
119126

127+
:root[data-theme="ocean"],
120128
body[data-theme="ocean"] {
121129
--bg-0: #03101b;
122130
--bg-1: #092138;
@@ -132,6 +140,7 @@ body[data-theme="ocean"] {
132140
--header: rgba(5, 16, 27, 0.92);
133141
}
134142

143+
:root[data-theme="bloodmoon"],
135144
body[data-theme="bloodmoon"] {
136145
--bg-0: #140506;
137146
--bg-1: #28090e;
@@ -147,6 +156,7 @@ body[data-theme="bloodmoon"] {
147156
--header: rgba(24, 7, 10, 0.92);
148157
}
149158

159+
:root[data-theme="paper"],
150160
body[data-theme="paper"] {
151161
--bg-0: #d9c8aa;
152162
--bg-1: #e8d9be;
@@ -162,6 +172,7 @@ body[data-theme="paper"] {
162172
--header: rgba(241, 229, 201, 0.94);
163173
}
164174

175+
:root[data-theme="blackflag"],
165176
body[data-theme="blackflag"] {
166177
--bg-0: #070b16;
167178
--bg-1: #101b32;
@@ -177,6 +188,7 @@ body[data-theme="blackflag"] {
177188
--header: rgba(10, 18, 36, 0.94);
178189
}
179190

191+
:root[data-theme="liquidglass"],
180192
body[data-theme="liquidglass"] {
181193
--bg-0: #091124;
182194
--bg-1: #122544;
@@ -206,6 +218,7 @@ body {
206218
font-family: "Space Grotesk", sans-serif;
207219
color: var(--ink);
208220
min-height: 100dvh;
221+
padding-bottom: 1.55rem;
209222
background-color: var(--bg-0);
210223
background:
211224
radial-gradient(920px 360px at 14% -12%, rgba(51, 111, 203, 0.36), transparent 62%),
@@ -2086,7 +2099,7 @@ body.browser-vivaldi .penguin-glasses {
20862099
}
20872100

20882101
.site-footer {
2089-
margin: 0.72rem auto 1.55rem;
2102+
margin: 0.72rem auto 0;
20902103
color: var(--muted);
20912104
text-align: center;
20922105
font-size: 0.8rem;

0 commit comments

Comments
 (0)