Jacky Zhao
2023-07-20 76c092dcf20959bc52fcb13b28cee50cd4217e40
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