Jacky Zhao
2025-04-18 b34d521293415944370fd0f5cf25cd71bcffb5b6
quartz/components/styles/darkmode.scss
@@ -1,17 +1,16 @@
.darkmode {
  cursor: pointer;
  padding: 0;
  position: relative;
  background: none;
  border: none;
  width: 20px;
  height: 20px;
  margin: 0 10px;
  & > .toggle {
    display: none;
    box-sizing: border-box;
  }
  margin: 0;
  text-align: inherit;
  flex-shrink: 0;
  & svg {
    cursor: pointer;
    opacity: 0;
    position: absolute;
    width: 20px;
    height: 20px;
@@ -21,20 +20,28 @@
  }
}
:root[saved-theme="dark"] .toggle ~ label {
  & > #dayIcon {
    opacity: 0;
:root[saved-theme="dark"] {
  color-scheme: dark;
}
:root[saved-theme="light"] {
  color-scheme: light;
}
:root[saved-theme="dark"] .darkmode {
  & > .dayIcon {
    display: none;
  }
  & > #nightIcon {
    opacity: 1;
  & > .nightIcon {
    display: inline;
  }
}
:root .toggle ~ label {
  & > #dayIcon {
    opacity: 1;
:root .darkmode {
  & > .dayIcon {
    display: inline;
  }
  & > #nightIcon {
    opacity: 0;
  & > .nightIcon {
    display: none;
  }
}