Jacky Zhao
2026-01-03 7dc826be0a9339b532f49e22ed540382f3b2cfc2
quartz/components/styles/darkmode.scss
@@ -1,45 +1,47 @@
.darkmode {
  float: right;
  padding: 1rem;
  min-width: 30px;
  cursor: pointer;
  padding: 0;
  position: relative;
  @media all and (max-width: 450px) {
    padding: 1rem;
  }
  & > .toggle {
    display: none;
    box-sizing: border-box;
  }
  background: none;
  border: none;
  width: 20px;
  height: 32px;
  margin: 0;
  text-align: inherit;
  flex-shrink: 0;
  & svg {
    cursor: pointer;
    opacity: 0;
    position: absolute;
    width: 20px;
    height: 20px;
    top: calc(50% - 10px);
    margin: 0 7px;
    fill: var(--darkgray);
    transition: opacity 0.1s ease;
  }
}
: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;
  }
}