Sidebar stays in place on long pages
The sections in the sidebar scrolled away with a long page (a person's Visa and stay tab, the activity log). The sidebar is now sticky under the top bar and as tall as the window; a window too short for it scrolls the sidebar on its own. On phones the row of sections stays under the top bar. A jump to an anchor (#doc-7 after an upload) lands below the bars that stay in place: scroll-padding of the top bar's height, plus the sections' row on phones.
This commit is contained in:
1 parent
7b9dff8a27
commit
e88bb74e1e
1 file changed
+19
@@ -57,6 +57,10 @@ html[data-theme="light"] {
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
/* a jump to #doc-7 lands below the bars that stay in place */
|
||||
html {
|
||||
scroll-padding-top: calc(var(--toph) + 16px);
|
||||
}
|
||||
body {
|
||||
margin: 0;
|
||||
background: var(--bg);
|
||||
@@ -187,7 +191,16 @@ h2 {
|
||||
grid-template-columns: var(--side) minmax(0, 1fr);
|
||||
min-height: calc(100vh - var(--toph));
|
||||
}
|
||||
/* the sections stay in place under the top bar on pages of any length; a
|
||||
sidebar taller than the window scrolls on its own */
|
||||
.side {
|
||||
position: sticky;
|
||||
top: var(--toph);
|
||||
z-index: 10;
|
||||
align-self: start;
|
||||
height: calc(100vh - var(--toph));
|
||||
height: calc(100dvh - var(--toph));
|
||||
overflow-y: auto;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 18px;
|
||||
@@ -1006,7 +1019,13 @@ textarea.mrz {
|
||||
.app {
|
||||
grid-template-columns: minmax(0, 1fr);
|
||||
}
|
||||
/* on phones the sections are a row that stays under the top bar */
|
||||
html {
|
||||
scroll-padding-top: calc(var(--toph) + 66px);
|
||||
}
|
||||
.side {
|
||||
height: auto;
|
||||
overflow: visible;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
|
||||
Reference in new issue
Block a user