Skip to content

Fix gh-88 #96

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 1, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/lib/HtmlHead.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,26 @@
import prism_light from "prismjs/themes/prism.min.css?url";
import styles_dark from "quilt-bulma/dist/style-dark.min.css?url";
import styles_light from "quilt-bulma/dist/style-light.min.css?url";
import { onMount } from "svelte";

let userPrefersDarkMode: boolean = false;
onMount(function () {
userPrefersDarkMode =
window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches;
window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", (e) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

incorrect indentation on this line for some reason

userPrefersDarkMode = e.matches;
});
});
</script>

<svelte:head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />

{#if userPrefersDarkMode}
<meta name="darkreader-lock" />
{/if}

<link rel="preconnect" href="https://quiltmc.org" />
<link rel="preconnect" href="https://fonts.bunny.net" />
<link rel="preconnect" href="https://kit.fontawesome.com" />
Expand Down