From dcaf806190efe1dde3d8392292555b76ace07bdb Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Mon, 10 Mar 2025 11:44:47 -0700 Subject: [PATCH] feat: support non-singleton darkmode --- quartz/components/Darkmode.tsx | 10 ++++------ quartz/components/scripts/darkmode.inline.ts | 9 ++++----- quartz/components/styles/darkmode.scss | 8 ++++---- 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/quartz/components/Darkmode.tsx b/quartz/components/Darkmode.tsx index f64aad6..afc23d7 100644 --- a/quartz/components/Darkmode.tsx +++ b/quartz/components/Darkmode.tsx @@ -1,6 +1,4 @@ -// @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 +// @ts-ignore import darkmodeScript from "./scripts/darkmode.inline" import styles from "./styles/darkmode.scss" import { QuartzComponent, QuartzComponentConstructor, QuartzComponentProps } from "./types" @@ -9,12 +7,12 @@ import { classNames } from "../util/lang" const Darkmode: QuartzComponent = ({ displayClass, cfg }: QuartzComponentProps) => { return ( -