Jacky Zhao
2024-02-02 e9fb0ecb96a2de53cf5f060c4e151f539ca4b089
quartz/components/Darkmode.tsx
@@ -4,10 +4,11 @@
import darkmodeScript from "./scripts/darkmode.inline"
import styles from "./styles/darkmode.scss"
import { QuartzComponentConstructor, QuartzComponentProps } from "./types"
import { classNames } from "../util/lang"
function Darkmode({ displayClass }: QuartzComponentProps) {
  return (
    <div class={`darkmode ${displayClass ?? ""}`}>
    <div class={classNames(displayClass, "darkmode")}>
      <input class="toggle" id="darkmode-toggle" type="checkbox" tabIndex={-1} />
      <label id="toggle-label-light" for="darkmode-toggle" tabIndex={-1}>
        <svg
@@ -18,7 +19,7 @@
          x="0px"
          y="0px"
          viewBox="0 0 35 35"
          style="enable-background:new 0 0 35 35;"
          style="enable-background:new 0 0 35 35"
          xmlSpace="preserve"
        >
          <title>Light mode</title>
@@ -34,7 +35,7 @@
          x="0px"
          y="0px"
          viewBox="0 0 100 100"
          style="enable-background='new 0 0 100 100'"
          style="enable-background:new 0 0 100 100"
          xmlSpace="preserve"
        >
          <title>Dark mode</title>