mirror of
https://github.com/jimeh/commonflow.org.git
synced 2026-02-19 05:46:40 +00:00
wip: add linters and formatters
This commit is contained in:
@@ -46,12 +46,10 @@ const canonicalUrl = Astro.url.href;
|
||||
<script is:inline>
|
||||
(function () {
|
||||
const mode = localStorage.getItem("theme");
|
||||
const prefersDark =
|
||||
window.matchMedia("(prefers-color-scheme: dark)").matches;
|
||||
if (
|
||||
mode === "dark" ||
|
||||
(mode !== "light" && prefersDark)
|
||||
) {
|
||||
const prefersDark = window.matchMedia(
|
||||
"(prefers-color-scheme: dark)",
|
||||
).matches;
|
||||
if (mode === "dark" || (mode !== "light" && prefersDark)) {
|
||||
document.documentElement.classList.add("dark");
|
||||
}
|
||||
})();
|
||||
@@ -64,8 +62,9 @@ const canonicalUrl = Astro.url.href;
|
||||
<script>
|
||||
document.addEventListener("astro:after-swap", () => {
|
||||
const mode = localStorage.getItem("theme");
|
||||
const prefersDark =
|
||||
window.matchMedia("(prefers-color-scheme: dark)").matches;
|
||||
const prefersDark = window.matchMedia(
|
||||
"(prefers-color-scheme: dark)",
|
||||
).matches;
|
||||
if (mode === "dark" || (mode !== "light" && prefersDark)) {
|
||||
document.documentElement.classList.add("dark");
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user