make flex more consistent, remove transition

This commit is contained in:
Jacky Zhao 2025-03-09 09:57:12 -07:00
parent 2802aa91f4
commit 1176deab7e
5 changed files with 39 additions and 55 deletions

View File

@ -26,9 +26,8 @@ export const defaultContentPageLayout: PageLayout = {
Component.PageTitle(), Component.PageTitle(),
Component.MobileOnly(Component.Spacer()), Component.MobileOnly(Component.Spacer()),
Component.Search(), Component.Search(),
Component.Explorer(),
Component.Darkmode(), Component.Darkmode(),
Component.Explorer(),
], ],
right: [ right: [
Component.Graph(), Component.Graph(),

View File

@ -8,6 +8,7 @@
height: 20px; height: 20px;
margin: 0 10px; margin: 0 10px;
text-align: inherit; text-align: inherit;
flex-shrink: 0;
& svg { & svg {
position: absolute; position: absolute;

View File

@ -30,6 +30,10 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
overflow-y: hidden; overflow-y: hidden;
flex: 0 1 auto;
&.collapsed {
flex: 0 1 1.2em;
}
@media all and ($mobile) { @media all and ($mobile) {
order: -1; order: -1;
@ -63,8 +67,18 @@
} }
} }
button#mobile-explorer, svg {
button#desktop-explorer { pointer-events: all;
transition: transform 0.35s ease;
& > polyline {
pointer-events: none;
}
}
}
button#mobile-explorer,
button#desktop-explorer {
background-color: transparent; background-color: transparent;
border: none; border: none;
text-align: left; text-align: left;
@ -89,15 +103,6 @@
.explorer.collapsed > & .fold { .explorer.collapsed > & .fold {
transform: rotateZ(-90deg); transform: rotateZ(-90deg);
} }
}
svg {
pointer-events: all;
& > polyline {
pointer-events: none;
}
}
} }
#explorer-content { #explorer-content {
@ -106,17 +111,10 @@
overflow-y: auto; overflow-y: auto;
margin-top: 0.5rem; margin-top: 0.5rem;
.explorer.collapsed > & > ul.overflow {
max-height: 0px;
}
& ul { & ul {
list-style: none; list-style: none;
margin: 0.08rem 0; margin: 0.08rem 0;
padding: 0; padding: 0;
transition:
max-height 0.35s ease,
transform 0.35s ease;
& li > a { & li > a {
color: var(--dark); color: var(--dark);

View File

@ -4,8 +4,10 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
&.desktop-only { overflow-y: hidden;
max-height: 40%; flex: 0 1 auto;
&:has(button#toc.collapsed) {
flex: 0 1 1.2rem;
} }
} }
@ -44,22 +46,7 @@ button#toc {
#toc-content { #toc-content {
list-style: none; list-style: none;
overflow: hidden;
overflow-y: auto;
max-height: 100%;
transition:
max-height 0.35s ease,
visibility 0s linear 0s;
position: relative; position: relative;
visibility: visible;
&.collapsed {
max-height: 0;
transition:
max-height 0.35s ease,
visibility 0s linear 0.35s;
visibility: hidden;
}
& ul { & ul {
list-style: none; list-style: none;

View File

@ -543,7 +543,6 @@ video {
div:has(> .overflow) { div:has(> .overflow) {
display: flex; display: flex;
overflow-y: auto;
max-height: 100%; max-height: 100%;
} }