Fix theme switcher under certain conditions

When privacy.resistFingerprinting set to true on Firefox, the `prefers-color-scheme` can never work.
This commit is contained in:
supercolbat 2023-08-05 10:31:24 -05:00
parent b7f5941313
commit 2c6ca005d4
No known key found for this signature in database
GPG Key ID: 4C9B319E75DD8072

View File

@ -17,9 +17,22 @@ html.light {
--alt: #ddd;
--alt-text: #333;
--black: #151515;
--body-text: #666;
color-scheme: light;
}
html.dark {
--primary: #151515;
--secondary: #1d1d1d;
--tertiary: #353535;
--text: #ffffffde;
--grey: #5454547a;
--alt: #333;
--alt-text: #ddd;
--body-text: #bbb;
color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
html {
--primary: #151515;
@ -29,6 +42,7 @@ html.light {
--grey: #5454547a;
--alt: #333;
--alt-text: #ddd;
--body-text: #bbb;
color-scheme: dark;
}
}
@ -50,23 +64,32 @@ a:hover {
}
h1 {
@apply text-4xl font-bold my-8 border-b-2 border-accent pb-2;
@apply text-4xl font-bold mt-8 mb-2 border-b-2 border-accent pb-2;
}
.h1-no-lg {
@apply my-8 border-b-2 border-accent pb-2;
@apply mt-8 mb-2 border-b-2 border-accent pb-2;
}
h2 {
@apply text-3xl font-bold my-8;
@apply text-3xl font-bold mt-8 mb-2;
}
h3 {
@apply text-2xl font-bold my-8;
@apply text-2xl font-bold mt-8 mb-2;
}
h4 {
@apply text-xl font-bold my-8;
@apply text-xl font-bold mt-8 mb-2;
}
p {
color: var(--body-text);
}
/* Between-paragraph spacing */
p + p {
@apply mt-4;
}
summary {