improve overlay design and fix footer

To fix:
- css split between nav and nav-tree repeated due to mobile
- right overlay needs padding adjustments and resizing for mobile
This commit is contained in:
outfoxxed 2024-10-14 17:19:10 -07:00
parent 0a69344f98
commit c516c950a8
Signed by: outfoxxed
GPG key ID: 4C88A185FB89301E
8 changed files with 132 additions and 174 deletions

View file

@ -43,23 +43,19 @@ const { headings } = Astro.props;
--- ---
<div class="header"> <div class="header">
<div class="header-item header-left"> <div class="header-item header-left">
<h3 class="header-title">
<a href="/">Quickshell</a>
</h3>
{url.length > 2 ? {url.length > 2 ?
<Nav mobile={true}/> <Nav mobile={true}/>
<div class="nav-collapsed-spacer header-spacer"/>
: null} : null}
<div class="spacer-mobile">|</div> <h3 class="header-title">
<h3 class="header-title mobile">
<a href="/">Quickshell</a> <a href="/">Quickshell</a>
</h3> </h3>
</div> </div>
<div class="header-item header-right"> <div class="header-item header-right">
<Search/> <Search/>
<div class="spacer-mobile">|</div> <div class="header-spacer"/>
<div class="spacer-desktop">|</div>
<ThemeSelect client:load /> <ThemeSelect client:load />
<div class="spacer-mobile">|</div> <div class="toc-collapsed-spacer header-spacer"/>
{url.length > 2 ? {url.length > 2 ?
<TOC headings={headings} types={sidebarData} mobile={true}/> <TOC headings={headings} types={sidebarData} mobile={true}/>
: null} : null}

View file

@ -57,26 +57,6 @@
} }
} }
@keyframes rotateIn {
from {
transform: rotate(0deg);
}
to {
transform: rotate(180deg);
}
}
@keyframes rotateOut {
from {
transform: rotate(180deg);
}
to {
transform: rotate(0deg);
}
}
@keyframes rotateIn90 { @keyframes rotateIn90 {
from { from {
transform: rotate(0deg); transform: rotate(0deg);

View file

@ -52,6 +52,8 @@ html {
--nav-selected-bkg: var(--blue) 100 90; --nav-selected-bkg: var(--blue) 100 90;
--nav-selected-text: var(--blue) 60 60; --nav-selected-text: var(--blue) 60 60;
--nav-indicator-bkg: var(--blue) 45 80; --nav-indicator-bkg: var(--blue) 45 80;
--overlay-bkg: var(--blue) 10 93;
--overlay-bkg-border: var(--blue) 10 75;
} }
html.dark { html.dark {
@ -93,6 +95,8 @@ html.dark {
--nav-selected-bkg: var(--blue) 40 13; --nav-selected-bkg: var(--blue) 40 13;
--nav-selected-text: var(--blue) 100 70; --nav-selected-text: var(--blue) 100 70;
--nav-indicator-bkg: var(--blue) 30 30; --nav-indicator-bkg: var(--blue) 30 30;
--overlay-bkg: var(--blue) 41 4;
--overlay-bkg-border: var(--blue) 17 13;
} }
* { * {
@ -103,7 +107,8 @@ html.dark {
} }
body { body {
min-height: 100svh; height: 100%;
height: max-content;
width: 100%; width: 100%;
display: flex;
flex-direction: column;
} }

View file

@ -3,7 +3,15 @@
.docslayout-root { .docslayout-root {
margin-inline: 0.618rem; margin-inline: 0.618rem;
margin-top: 4rem; margin-top: 3.5rem;
display: flex;
justify-content: center;
flex-direction: row;
flex-grow: 1;
}
.docslayout-inner {
flex-grow: 1;
} }
.docs { .docs {
@ -11,10 +19,6 @@
flex-direction: row; flex-direction: row;
} }
.docslayout-inner {
min-height: 100svh;
}
.docs-content { .docs-content {
flex-grow: 1; flex-grow: 1;
@ -33,13 +37,8 @@
} }
} }
.spacer-desktop {
display: none;
}
.c-breadcrumbs { .c-breadcrumbs {
--color-link-breadcrumbs: hsl(var(--accent-600)); --color-link-breadcrumbs: hsl(var(--accent-600));
margin-top: 1.056rem;
margin-bottom: 0.318rem; margin-bottom: 0.318rem;
max-width: 100svw; max-width: 100svw;
} }
@ -100,19 +99,13 @@ ul {
} }
.c-breadcrumbs { .c-breadcrumbs {
margin-top: 1.056rem;
margin-inline: 1.272rem; margin-inline: 1.272rem;
} }
} }
@media (min-width: 85rem) { @media (min-width: 85rem) {
.docslayout-root {
display: flex;
justify-content: center;
flex-direction: row;
}
.docslayout-inner { .docslayout-inner {
flex-grow: 1;
max-width: 80rem; max-width: 80rem;
} }

View file

@ -40,10 +40,15 @@
height: 24px; height: 24px;
border-radius: 50%; border-radius: 50%;
margin-left: 3px; margin-left: 3px;
transition: transform 250ms ease-in-out;
&:hover { &:hover {
background-color: hsl(var(--nav-indicator-bkg)); background-color: hsl(var(--nav-indicator-bkg));
} }
&[data-state="open"] {
transform: rotate(180deg);
}
} }
.nav-shevron { .nav-shevron {
@ -54,18 +59,10 @@ html.dark .nav-shevron {
color: white; color: white;
} }
[data-scope="accordion"][data-part="item-indicator"][data-state="open"] {
animation: rotateIn 250ms ease-in-out forwards;
}
[data-scope="accordion"][data-part="item-indicator"][data-state="closed"] {
animation: rotateOut 250ms ease-in-out;
}
[data-scope="accordion"][data-part="item-content"] { [data-scope="accordion"][data-part="item-content"] {
--height: 709; --height: 709;
margin-block: 0.175rem; margin-block: 0.175rem;
margin-left: 1.4rem; margin-left: 1.6rem;
& .arktree-item, & .arktree-item,
[data-part="item-content"]>div { [data-part="item-content"]>div {

View file

@ -13,17 +13,11 @@
max-height: 500px; max-height: 500px;
scrollbar-width: none; scrollbar-width: none;
-ms-overflow-style: none; -ms-overflow-style: none;
--width: 25rem;
&::-webkit-scrollbar { &::-webkit-scrollbar {
display: none; display: none;
} }
& div {
height: max-content;
width: 100%;
}
&:hover { &:hover {
cursor: pointer; cursor: pointer;
} }
@ -33,100 +27,110 @@
z-index: 11; z-index: 11;
overflow: hidden; overflow: hidden;
top: 2.6rem; top: 2.6rem;
left: -1rem; left: calc(-3rem + -80svw);
width: 0;
height: calc(100svh - 2.5rem); height: calc(100svh - 2.5rem);
font-size: 1rem;
scrollbar-width: none; scrollbar-width: none;
font-size: 1.2rem;
-ms-overflow-style: none; -ms-overflow-style: none;
background-color: hsl(var(--overlay-bkg));
border-right: solid hsl(var(--overlay-bkg-border)) 1px;
&::-webkit-scrollbar { &::-webkit-scrollbar {
display: none; display: none;
} }
transition: transition:
width 0.3s ease, left 0.3s ease,
height 0.3s ease,
background-color 0.3s ease,
backdrop-filter 0.3s ease,
padding 0.3s ease; padding 0.3s ease;
&.shown { &.shown {
width: var(--width);
background-color: hsl(var(--bg-900) / 0.6);
backdrop-filter: blur(3px) saturate(180%);
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; left: -1rem;
} }
& .navtree { & .navtree {
padding: 1rem; /* lines up with non overlay nav */
padding: 0.5rem 0.618rem;
height: 100%; height: 100%;
width: 100%; width: 80svw;
overflow-x: hidden; box-sizing: content-box;
overflow-y: scroll; overflow-y: scroll;
margin-bottom: 4rem; scrollbar-width: none;
padding-left: 1rem; -ms-overflow-style: none;
margin-bottom: 1rem;
text-wrap: nowrap; text-wrap: nowrap;
& [data-part="item-indicator"] {
margin-left: 1rem;
margin-right: 0.8rem;
height: 2rem;
width: 2rem;
& svg {
height: max-content;
width: 100%;
}
}
& [data-part="item-trigger"] { & [data-part="item-trigger"] {
max-width: 90%; min-height: 3em;
font-size: 1.2rem;
}
& [data-part="item-content"] {
margin-left: 3.7rem;
} }
& [data-part="item"] { & [data-part="item"] {
margin-left: unset; & [data-part="item-content"] > div {
display: flex; min-height: 3em;
flex-direction: column; & > p { margin: auto 0; }
align-items: flex-start;
padding-right: 0;
& [data-part="item-content"] {
& [data-part="item-trigger"] {
margin-left: 1em;
& p {
text-align: left;
}
}
& [data-part="item-content"] {
max-width: 80%;
margin-left: 3.33em;
& > div {
display: grid;
& a {
display: grid;
justify-items: start;
align-items: center;
min-height: 100%;
}
}
}
} }
} }
} }
} }
} }
@media (max-width: 40rem) { @media (min-width: 40rem) {
.nav-toggle { .nav-toggle {
--width: 100svw; .nav-items {
font-size: 1rem;
top: 2.5rem;
left: -24rem;
& svg { & .navtree {
height: max-content; width: 21rem;
width: 100%;
}
& .navtree {
& [data-part="item-trigger"] {
min-height: 3em;
} }
& [data-part="item-content"] > div { & .navtree {
min-height: 4em; & [data-part="item-indicator"] {
margin-left: 0.2rem;
margin-right: 0rem;
height: 1.5rem;
width: 1.5rem;
& svg {
height: unset;
width: unset;
}
}
& [data-part="item-trigger"] {
min-height: 2.2rem;
font-size: 1rem;
}
& [data-part="item-content"] {
margin-left: 1.6rem;
}
& [data-part="item"] {
& [data-part="item-content"] > div {
min-height: 2.2rem;
}
}
} }
} }
} }
@ -141,10 +145,10 @@
display: block; display: block;
width: 21rem; width: 21rem;
position: sticky; position: sticky;
top: 4rem; top: 3.5rem;
flex-shrink: 0; flex-shrink: 0;
overflow: scroll; overflow-y: scroll;
max-height: calc(100svh - 8rem); max-height: calc(100svh - 4rem);
scrollbar-width: none; scrollbar-width: none;
-ms-overflow-style: none; -ms-overflow-style: none;
z-index: 10; z-index: 10;
@ -153,5 +157,6 @@
.navtree { .navtree {
width: 100%; width: 100%;
z-index: 1; z-index: 1;
margin: 0.5rem 0;
} }
} }

View file

@ -28,7 +28,7 @@
} }
.toc-toggle { .toc-toggle {
--width: 100svw; --width: 80svw;
display: block; display: block;
position: unset; position: unset;
height: 24px; height: 24px;
@ -51,32 +51,27 @@
& .toc-mobile { & .toc-mobile {
position: absolute; position: absolute;
top: 2.6rem; top: 2.5rem;
right: -1rem; right: -1rem;
width: 0; width: 0;
height: max(min(100svh, 800px), calc(100svh - 8rem)); height: calc(100svh - 3.5rem);
font-size: 0.745rem; font-size: 1rem;
font-weight: 600;
scrollbar-width: none; scrollbar-width: none;
-ms-overflow-style: none; -ms-overflow-style: none;
background-color: hsl(var(--overlay-bkg));
border-left: solid hsl(var(--overlay-bkg-border)) 1px;
&::-webkit-scrollbar { &::-webkit-scrollbar {
display: none; display: none;
} }
transition: width 0.3s ease, transition:
height 0.3s ease, width 0.3s ease,
background-color 0.3s ease, padding 0.3s ease;
backdrop-filter 0.3s ease,
padding 0.3s ease;
&.shown { &.shown {
overflow-y: scroll; overflow-y: scroll;
padding: 0.3rem;
width: var(--width); width: var(--width);
height: max(min(100svh, 800px), calc(100svh - 8rem));
background-color: hsl(var(--bg-900) / 0.6);
backdrop-filter: blur(3px) saturate(180%);
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
@ -95,6 +90,11 @@
} }
@media (min-width: 65rem) { @media (min-width: 65rem) {
.toc-wrapper {
width: 19rem;
flex-shrink: 0;
}
.toc-wrapper-mobile { .toc-wrapper-mobile {
display: none; display: none;
} }
@ -104,9 +104,9 @@
background-color: transparent; background-color: transparent;
display: block; display: block;
position: sticky; position: sticky;
top: 4rem; top: 3.5rem;
width: max-content; width: 19rem;
max-height: calc(100svh - 8rem); max-height: calc(100svh - 4rem);
overflow-y: scroll; overflow-y: scroll;
z-index: 9; z-index: 9;
margin-right: 1.272rem; margin-right: 1.272rem;
@ -140,9 +140,3 @@
} }
} }
} }
@media (min-width: 85rem) {
.toc-wrapper {
width: 19rem;
}
}

View file

@ -63,14 +63,16 @@ html.dark {
position: fixed; position: fixed;
top: 0; top: 0;
width: 100%; width: 100%;
z-index: 10; z-index: 12;
display: flex; display: flex;
align-items: center; align-items: center;
height: 3.5rem; height: 3.5rem;
padding-left: 1rem;
padding-right: 1rem;
} }
.header-title { .header-title {
display: none; display: block;
font-size: 1.614em; font-size: 1.614em;
font-weight: 700; font-weight: 700;
line-height: 1.272; line-height: 1.272;
@ -90,17 +92,17 @@ html.dark {
.header-left { .header-left {
justify-content: flex-start; justify-content: flex-start;
padding-left: 1rem;
} }
.header-right { .header-right {
justify-content: flex-end; justify-content: flex-end;
padding-right: 1rem;
} }
.spacer-mobile { .header-spacer {
font-size: 1.374rem; height: 1.5rem;
color: hsla(var(--white) 40 50 / 0.3); width: 2px;
background-color: hsla(var(--white) 40 50 / 0.3);
display: block;
} }
.theme-toggle { .theme-toggle {
@ -115,7 +117,6 @@ html.dark {
footer { footer {
position: sticky; position: sticky;
bottom: -3.5rem; bottom: -3.5rem;
z-index: 10;
width: 100%; width: 100%;
height: 3.5rem; height: 3.5rem;
font-size: min(1.112rem, max(1svw, 0.8rem)); font-size: min(1.112rem, max(1svw, 0.8rem));
@ -190,23 +191,10 @@ footer {
} }
} }
@media (min-width: 85rem) { @media (min-width: 65rem) {
.header-title { .toc-collapsed-spacer { display: none }
display: block; }
}
@media (min-width: 85rem) {
.header-title.mobile { .nav-collapsed-spacer { display: none }
display: none;
}
.menu-toggle,
.spacer-mobile {
display: none;
}
.spacer-desktop {
display: block;
font-size: 1.374rem;
color: hsla(var(--white) 40 50 / 0.3);
}
} }