Skip to content

Commit 941527e

Browse files
committed
Sidebar: Add image and fix scroll behaviour
1 parent 4200a46 commit 941527e

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

assets/css/v2/style.css

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@ textarea:not([rows]) {
247247
--grid-columns: 12;
248248

249249
--sidebar-width: 22rem;
250+
--sidebar-item-padding: 0.25rem 0.75rem;
250251
--content-max-width: 88rem;
251252

252253
--main-col: minmax(34rem, 50rem);
@@ -418,12 +419,12 @@ ol li:last-child {
418419
left: 0;
419420
width: var(--sidebar-width);
420421
height: 100vh;
421-
/* TODO replace with correct color var */
422422
border-right: 1px solid oklch(var(--color-divider));
423423
overflow: hidden;
424424
background: oklch(var(--color-background));
425425
box-sizing: border-box;
426426
transform: translateX(0);
427+
padding: var(--space-s) 0 var(--space-s) var(--space-s);
427428

428429
.sidebar__container {
429430
display: grid;
@@ -435,16 +436,18 @@ ol li:last-child {
435436
top: 0;
436437
background: oklch(var(--color-background));
437438
z-index: 1;
439+
padding: var(--sidebar-item-padding);
438440

439441
.sidebar__img {
440-
height: 1.75rem;
442+
height: 2rem;
441443
}
442444
}
443445

444446
.sidebar__content {
445447
overflow-y: auto;
446448
min-height: 0;
447-
width: 100%;
449+
/* allows space for scrollbar */
450+
width: calc(var(--sidebar-width) - 1rem);
448451
scrollbar-gutter: stable;
449452
}
450453
}
@@ -1043,7 +1046,7 @@ nav.sidebar.sidebar__mobile-open {
10431046
}
10441047

10451048
.sidebar__container button {
1046-
padding: 0.25rem 0.75rem;
1049+
padding: var(--sidebar-item-padding);
10471050
justify-content: space-between;
10481051
}
10491052

@@ -1105,7 +1108,7 @@ nav.sidebar.sidebar__mobile-open {
11051108

11061109
.sidebar__link {
11071110
display: block;
1108-
padding: 0.25rem 0.75rem;
1111+
padding: var(--sidebar-item-padding);
11091112
margin: 2px 0 2px 0;
11101113
border-radius: 5px 0 0 5px;
11111114
color: oklch(0 0 0 / 0.75);

layouts/partials/sidebar-v2.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@
2222
{{ $productName := index $productMap $productIdentifier }}
2323

2424
<div class="sidebar__container">
25-
<div class="sidebar__header">NGINX LOGO</div>
25+
<div class="sidebar__header">
26+
<img class="sidebar__img" src="{{ "/images/icons/NGINX-Docs-horiz-black-type.svg" | absURL }}" alt="NGINX Docs">
27+
</div>
2628
<div class="sidebar__content">
2729
<a class="skip-link" href="#maincontent">Skip Navigation</a>
2830
{{ partial "sidebar-list.html" (dict

0 commit comments

Comments
 (0)