Skip to content

Commit e27e413

Browse files
authored
Adjust navbar heights and main-container layout (google#2528)
1 parent a8db3e0 commit e27e413

21 files changed

Lines changed: 262 additions & 62 deletions

File tree

.vscode/cspell.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"caseSensitive": true,
55
"words": [
66
"anchorize",
7+
"baseof",
78
"chalin",
89
"CNCF",
910
"docset",

assets/scss/td/_footer.scss

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@
66
min-height: 150px;
77
padding-top: map-get($spacers, 5);
88

9-
@include media-breakpoint-down(lg) {
10-
min-height: 200px;
11-
}
12-
139
/* &__left { } */
1410

1511
&__center {

assets/scss/td/_main-container.scss

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,14 @@
22
.td-outer {
33
display: flex;
44
flex-direction: column;
5-
min-height: 100vh;
5+
6+
min-height: calc(
7+
100vh - #{$td-navbar-min-height} - #{$td-navbar__main-min-height-mobile}
8+
);
9+
10+
@include media-breakpoint-up(md) {
11+
min-height: 100vh;
12+
}
613
}
714

815
// The outer page container for the default base template.
@@ -24,12 +31,9 @@
2431

2532
.td-main {
2633
flex-grow: 1;
27-
@at-root .td-section &,
28-
.td-page & {
29-
// Use flex so descendant elements (like <main>) can grow to fill the
30-
// available vertical (viewport) space, but only for docs layouts (it breaks
31-
// td-home, which needs column-based layout). We select docs layouts via
32-
// .td-section and .td-page above.
34+
// Use flex when this container has a sidebar so descendant elements with
35+
// flex:1 (like <main> in docs layouts) can grow.
36+
&:has(> .row > .td-sidebar) {
3337
display: flex;
3438
}
3539
}

assets/scss/td/_nav.scss

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ $td-link-underline-offsets: (
2929
backdrop-filter: var(--td-navbar-backdrop-filter);
3030
border-bottom: var(--td-navbar-border-bottom);
3131

32-
min-height: $td-navbar-min-height;
32+
min-height: $td-navbar-min-height + $td-navbar__main-min-height-mobile;
3333
margin: 0;
3434
z-index: 32;
3535

@@ -74,6 +74,8 @@ $td-link-underline-offsets: (
7474
}
7575
}
7676

77+
// &__main { }
78+
7779
// For .td-search__input styling, see _search.scss
7880

7981
.dropdown {
@@ -83,6 +85,7 @@ $td-link-underline-offsets: (
8385
@include media-breakpoint-up(md) {
8486
position: fixed;
8587
top: 0;
88+
min-height: $td-navbar-min-height;
8689
width: 100%;
8790

8891
.nav-item {

assets/scss/td/_navbar-mobile-scroll.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
@include media-breakpoint-down(lg) {
1010
.td-navbar-nav-scroll {
1111
max-width: 100%;
12-
height: 2.5rem;
12+
min-height: $td-navbar__main-min-height-mobile;
1313
overflow: hidden;
1414
font-size: 0.9rem;
1515
}

assets/scss/td/_sidebar-toc.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@
1212

1313
@supports (position: sticky) {
1414
position: sticky;
15+
16+
// Keep the sidebar below the fixed navbar in both states: margin-top
17+
// applies in normal flow (before stickiness); top applies in the sticky
18+
// state.
19+
top: $td-navbar-min-height;
1520
margin-top: $td-navbar-min-height;
1621
height: calc(100vh - #{$td-navbar-min-height});
1722
overflow-y: auto;

assets/scss/td/_variables.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,4 @@ $td-block-space-bottom-base: 4 * $spacer !default;
4545

4646
$td-navbar-bg-color: rgba(var(--bs-body-bg-rgb), var(--bs-bg-opacity)) !default;
4747
$td-navbar-min-height: 4rem !default;
48+
$td-navbar__main-min-height-mobile: 2.5rem !default;

assets/scss/td/blocks/_blocks.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
@import 'cover';
22

3+
.td-below-navbar {
4+
&.td-box,
5+
&.td-cover-block {
6+
@include media-breakpoint-up(md) {
7+
margin-top: $td-navbar-min-height;
8+
padding-top: $td-block-space-top-base !important;
9+
}
10+
}
11+
}
12+
313
.td-bg-arrow {
414
&-wrapper {
515
position: relative;

assets/scss/td/blocks/_cover.scss

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,6 @@
22

33
@include td-box-height-modifiers('.td-cover-block');
44

5-
.td-cover-block {
6-
&.td-below-navbar {
7-
@include media-breakpoint-up(md) {
8-
margin-top: $td-navbar-min-height;
9-
padding-top: $td-block-space-top-base !important;
10-
}
11-
}
12-
}
13-
145
.td-cover-logo {
156
margin-right: 0.5em;
167
}

docsy.dev/assets/scss/_navbar.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@
3030
.nav-link {
3131
--bs-nav-link-color: initial;
3232
}
33+
34+
.td-search {
35+
color: initial;
36+
}
3337
}
3438
}
3539
}

0 commit comments

Comments
 (0)