Skip to content

Commit 5a39358

Browse files
authored
Merge pull request #51 from stackabletech/fix/sidebar-menu-css
Fix: sidebar and toolbar CSS
2 parents c8910b3 + 688b42a commit 5a39358

File tree

3 files changed

+25
-6
lines changed

3 files changed

+25
-6
lines changed

src/css/nav.css

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
/* This file contains the CSS for the sidebar navigation.
2+
* The vertical navigation at the top is in the header.css
3+
* At less than 770px, the navbar disappears and is opened with
4+
* a button in the toolbar.
5+
*
6+
* Some of the responsiveness is about adjusting the height of the
7+
* menu. On smaller screens the vertical menu disappears, so the height
8+
* of the sidebar menu needs to be adjusted.
9+
*/
10+
111
.nav-container {
212
position: fixed;
313
top: var(--navbar-height);
@@ -32,7 +42,7 @@
3242
background: var(--nav-background);
3343
position: relative;
3444
top: var(--toolbar-height);
35-
height: var(--nav-height);
45+
height: calc(100% - var(--navbar-sub-height));
3646
}
3747

3848
@media screen and (min-width: 769px) {
@@ -43,10 +53,11 @@
4353

4454
@media screen and (min-width: 1024px) {
4555
.nav {
46-
top: var(--navbar-height);
56+
top: calc(var(--navbar-height) + var(--navbar-sub-height));
4757
box-shadow: none;
4858
position: sticky;
4959
height: var(--nav-height--desktop);
60+
margin-top: var(--navbar-sub-height);
5061
}
5162
}
5263

@@ -63,7 +74,7 @@ html.is-clipped--nav {
6374
.nav-panel-menu {
6475
overflow-y: scroll;
6576
overscroll-behavior: none;
66-
height: var(--nav-panel-menu-height);
77+
height: 100%;
6778
}
6879

6980
.nav-panel-menu:not(.is-active) .nav-menu {

src/css/toolbar.css

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/* The toolbar contains a home link and breakcrumbs and is found
2+
* right above the article content.
3+
* On smaller screens it also contains a button to show the sidebar menu.
4+
*/
5+
16
.toolbar {
27
color: var(--toolbar-font-color);
38
align-items: center;
@@ -12,6 +17,12 @@
1217
z-index: var(--z-index-toolbar);
1318
}
1419

20+
@media screen and (min-width: 1024px) {
21+
.toolbar {
22+
top: calc(var(--navbar-height) + var(--navbar-sub-height));
23+
}
24+
}
25+
1526
.toolbar a {
1627
color: inherit;
1728
}

src/css/vars.css

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,10 @@
123123
--navbar-height: calc(73 / var(--rem-base) * 1rem);
124124
--navbar-sub-height: calc(45 / var(--rem-base) * 1rem);
125125
--toolbar-height: calc(45 / var(--rem-base) * 1rem);
126-
--drawer-height: var(--toolbar-height);
127126
--body-top: calc(var(--navbar-height) + var(--navbar-sub-height));
128127
--body-min-height: calc(100vh - var(--body-top));
129128
--nav-height: calc(var(--body-min-height) - var(--toolbar-height));
130129
--nav-height--desktop: var(--body-min-height);
131-
--nav-panel-menu-height: calc(100% - var(--drawer-height));
132-
--nav-panel-explore-height: calc(50% + var(--drawer-height));
133130
--nav-width: calc(270 / var(--rem-base) * 1rem);
134131
--toc-top: calc(var(--body-top) + var(--toolbar-height));
135132
--toc-height: calc(100vh - var(--toc-top) - 2.5rem);

0 commit comments

Comments
 (0)