From 08f8e3b4a4879dd7c91c16fbce80c4f2bc5e357f Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Mon, 10 Jul 2023 02:32:24 +0000
Subject: [PATCH] docs + various polish

---
 quartz/components/Darkmode.tsx |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/quartz/components/Darkmode.tsx b/quartz/components/Darkmode.tsx
index 0161e0a..49f61c7 100644
--- a/quartz/components/Darkmode.tsx
+++ b/quartz/components/Darkmode.tsx
@@ -1,7 +1,11 @@
+// @ts-ignore: this is safe, we don't want to actually make darkmode.inline.ts a module as 
+// modules are automatically deferred and we don't want that to happen for critical beforeDOMLoads
+// see: https://v8.dev/features/modules#defer
 import darkmodeScript from "./scripts/darkmode.inline"
-import styles from '../styles/darkmode.scss'
+import styles from './styles/darkmode.scss'
+import { QuartzComponentConstructor } from "./types"
 
-export default function Darkmode() {
+function Darkmode() {
   return <div class="darkmode">
     <input class="toggle" id="darkmode-toggle" type="checkbox" tabIndex={-1} />
     <label id="toggle-label-light" for="darkmode-toggle" tabIndex={-1}>
@@ -45,3 +49,5 @@
 
 Darkmode.beforeDOMLoaded = darkmodeScript
 Darkmode.css = styles
+
+export default (() => Darkmode) satisfies QuartzComponentConstructor

--
Gitblit v1.10.0