16 lines
768 B
TypeScript
16 lines
768 B
TypeScript
// @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 { QuartzComponent, QuartzComponentConstructor, QuartzComponentProps } from "./types"
|
|
import { classNames } from "../util/lang"
|
|
|
|
const Darkmode: QuartzComponent = ({ displayClass }: QuartzComponentProps) => {
|
|
return <div class={classNames(displayClass, "darkmode permanent-darkmode")} />
|
|
}
|
|
|
|
Darkmode.beforeDOMLoaded = darkmodeScript
|
|
Darkmode.css = styles
|
|
|
|
export default (() => Darkmode) satisfies QuartzComponentConstructor
|