diff --git a/quartz.layout.ts b/quartz.layout.ts index e41518b4b..f45da0c92 100644 --- a/quartz.layout.ts +++ b/quartz.layout.ts @@ -26,9 +26,8 @@ export const defaultContentPageLayout: PageLayout = { Component.PageTitle(), Component.MobileOnly(Component.Spacer()), Component.Search(), - - Component.Explorer(), Component.Darkmode(), + Component.Explorer(), ], right: [ Component.Graph(), diff --git a/quartz/components/styles/darkmode.scss b/quartz/components/styles/darkmode.scss index edf4e61cf..42952823a 100644 --- a/quartz/components/styles/darkmode.scss +++ b/quartz/components/styles/darkmode.scss @@ -8,6 +8,7 @@ height: 20px; margin: 0 10px; text-align: inherit; + flex-shrink: 0; & svg { position: absolute; diff --git a/quartz/components/styles/explorer.scss b/quartz/components/styles/explorer.scss index e15a248d6..664953495 100644 --- a/quartz/components/styles/explorer.scss +++ b/quartz/components/styles/explorer.scss @@ -30,6 +30,10 @@ display: flex; flex-direction: column; overflow-y: hidden; + flex: 0 1 auto; + &.collapsed { + flex: 0 1 1.2em; + } @media all and ($mobile) { order: -1; @@ -63,36 +67,9 @@ } } - button#mobile-explorer, - button#desktop-explorer { - background-color: transparent; - border: none; - text-align: left; - cursor: pointer; - padding: 0; - color: var(--dark); - display: flex; - align-items: center; - - & h2 { - font-size: 1rem; - display: inline-block; - margin: 0; - } - - & .fold { - margin-left: 0.5rem; - transition: transform 0.3s ease; - opacity: 0.8; - } - - .explorer.collapsed > & .fold { - transform: rotateZ(-90deg); - } - } - svg { pointer-events: all; + transition: transform 0.35s ease; & > polyline { pointer-events: none; @@ -100,23 +77,44 @@ } } +button#mobile-explorer, +button#desktop-explorer { + background-color: transparent; + border: none; + text-align: left; + cursor: pointer; + padding: 0; + color: var(--dark); + display: flex; + align-items: center; + + & h2 { + font-size: 1rem; + display: inline-block; + margin: 0; + } + + & .fold { + margin-left: 0.5rem; + transition: transform 0.3s ease; + opacity: 0.8; + } + + .explorer.collapsed > & .fold { + transform: rotateZ(-90deg); + } +} + #explorer-content { list-style: none; overflow: hidden; overflow-y: auto; margin-top: 0.5rem; - .explorer.collapsed > & > ul.overflow { - max-height: 0px; - } - & ul { list-style: none; margin: 0.08rem 0; padding: 0; - transition: - max-height 0.35s ease, - transform 0.35s ease; & li > a { color: var(--dark); diff --git a/quartz/components/styles/toc.scss b/quartz/components/styles/toc.scss index cb4ef3d43..d1feca67a 100644 --- a/quartz/components/styles/toc.scss +++ b/quartz/components/styles/toc.scss @@ -4,8 +4,10 @@ display: flex; flex-direction: column; - &.desktop-only { - max-height: 40%; + overflow-y: hidden; + flex: 0 1 auto; + &:has(button#toc.collapsed) { + flex: 0 1 1.2rem; } } @@ -44,22 +46,7 @@ button#toc { #toc-content { list-style: none; - overflow: hidden; - overflow-y: auto; - max-height: 100%; - transition: - max-height 0.35s ease, - visibility 0s linear 0s; position: relative; - visibility: visible; - - &.collapsed { - max-height: 0; - transition: - max-height 0.35s ease, - visibility 0s linear 0.35s; - visibility: hidden; - } & ul { list-style: none; diff --git a/quartz/styles/base.scss b/quartz/styles/base.scss index 095bea755..e0ab076b5 100644 --- a/quartz/styles/base.scss +++ b/quartz/styles/base.scss @@ -543,7 +543,6 @@ video { div:has(> .overflow) { display: flex; - overflow-y: auto; max-height: 100%; }