1 gal Rosemary
2025-04-05 bb24cd13c7fafbd42d3980c45351a58a76dabb18
quartz/components/styles/toc.scss
@@ -1,25 +1,71 @@
details.toc {
  & summary {
    cursor: pointer;
@use "../../styles/variables.scss" as *;
    &::marker {
      color: var(--dark);
    }
.toc {
  display: flex;
  flex-direction: column;
    & > * {
      padding-left: 0.25rem;
      display: inline-block;
      margin: 0;
    }
  overflow-y: hidden;
  min-height: 1.2rem;
  flex: 0 1 auto;
  &:has(button.toc-header.collapsed) {
    flex: 0 1 1.2rem;
  }
  & ul {
    list-style: none;
    margin: 0.5rem 1.25rem;
    padding: 0;
}
@media all and not ($mobile) {
  .toc-header {
    display: flex;
  }
}
button.toc-header {
  background-color: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
  padding: 0;
  color: var(--dark);
  display: flex;
  align-items: center;
  & h3 {
    font-size: 1rem;
    display: inline-block;
    margin: 0;
  }
  @for $i from 1 through 6 {
  & .fold {
    margin-left: 0.5rem;
    transition: transform 0.3s ease;
    opacity: 0.8;
  }
  &.collapsed .fold {
    transform: rotateZ(-90deg);
  }
}
ul.toc-content {
  list-style: none;
  position: relative;
  margin: 0.5rem 0;
  padding: 0;
  height: 5rem;
  overscroll-behavior: contain;
  list-style: none;
  & > li > a {
    color: var(--dark);
    opacity: 0.35;
    transition:
      0.5s ease opacity,
      0.3s ease color;
    &.in-view {
      opacity: 0.75;
    }
  }
  @for $i from 0 through 6 {
    & .depth-#{$i} {
      padding-left: calc(1rem * #{$i});
    }