Skip to content

Commit fd2aee1

Browse files
nginx-jackdanielledeleo
authored andcommitted
Grid: Center justify text content
Move breadcrumb into same element as text content to allow it to follow the content on larger screens. Slightly increase gutter gap on larger screens.
1 parent 6a444e1 commit fd2aee1

File tree

3 files changed

+32
-18
lines changed

3 files changed

+32
-18
lines changed

assets/css/v2/style.css

+18-4
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575

7676
/* vars for the primary grid setup */
7777
--grid-sidebar: 24rem;
78+
--grid-sidebar-gutter: 3rem;
7879
--grid-content: minmax(34rem, 50rem);
7980
--grid-content-mobile: minmax(20rem, 50rem);
8081
--grid-side-callout: minmax(18rem, 26rem);
@@ -353,9 +354,8 @@ nav {
353354
.content-layout {
354355
display: grid;
355356
grid-template-columns: 1fr 1fr;
356-
grid-template-rows: var(--breadcrumb-max-height) 1fr;
357+
grid-template-rows: 1fr;
357358
z-index: 1;
358-
margin-top: 2rem;
359359
}
360360

361361
.docs-container {
@@ -427,6 +427,7 @@ nav {
427427

428428
@media (min-width: 88em) {
429429
.base-layout {
430+
--grid-column-gutter: 4.5rem;
430431
display: grid;
431432
grid-template-rows: repeat(2, auto);
432433
column-gap: var(--grid-column-gutter);
@@ -435,6 +436,7 @@ nav {
435436

436437
.text-content {
437438
grid-template-columns: var(--grid-content) var(--grid-side-callout);
439+
grid-template-rows: 70px auto;
438440
column-gap: var(--grid-column-gutter);
439441
}
440442

@@ -445,12 +447,19 @@ nav {
445447
.main-layout {
446448
display: grid;
447449
grid-template-columns: var(--sidebar-width) 1fr;
448-
column-gap: var(--grid-column-gutter);
450+
column-gap: var(--grid-sidebar-gutter);
449451
}
450452

451453
.content-layout {
452454
display: grid;
453-
grid-template-columns: var(--grid-content) var(--grid-side-callout);
455+
grid-template-columns: 1fr minmax(
456+
auto,
457+
calc(
458+
var(--grid-content) +
459+
var(--grid-side-callout) +
460+
var(--grid-column-gutter)
461+
)
462+
) 1fr;
454463
column-gap: var(--grid-column-gutter);
455464
}
456465

@@ -472,6 +481,11 @@ nav {
472481
}
473482
}
474483

484+
/* Handles different flow-gap of list page */
485+
.list-page.text-content {
486+
grid-template-rows: calc(70px + var(--flow-gap)) auto;
487+
}
488+
475489
.api {
476490
margin: 2rem 0 2rem 2rem;
477491
width: 100%;

layouts/_default/docs.html

+7-7
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@
2222
</div>
2323

2424
<section class="content-layout">
25-
<section class="breadcrumb-layout" data-mf="true" style="display: none;">
26-
{{ if not .IsHome }}
27-
{{ if not (in .Params.display_breadcrumb "false" ) }}
28-
{{ partial "breadcrumb" .}}
29-
{{ end }}
30-
{{ end }}
31-
</section>
3225
<div class="text-content">
26+
<section class="breadcrumb-layout" data-mf="true" style="display: none;">
27+
{{ if not .IsHome }}
28+
{{ if not (in .Params.display_breadcrumb "false" ) }}
29+
{{ partial "breadcrumb" .}}
30+
{{ end }}
31+
{{ end }}
32+
</section>
3333
<h1>{{ .Title }}</h1>
3434
{{ .Content }}
3535
{{ if eq .Page.Draft true }}{{ partial "draft-badge.html" . }}{{ end }}

layouts/_default/list.html

+7-7
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@
1919
</div>
2020

2121
<section class="content-layout" data-mf="true" style="display: none">
22-
<section class="breadcrumb-layout">
23-
{{ if not .IsHome }}
24-
{{ if not (in .Params.display_breadcrumb "false" ) }}
25-
{{ partial "breadcrumb" .}}
26-
{{ end }}
27-
{{ end }}
28-
</section>
2922
<div class="text-content list-page">
23+
<section class="breadcrumb-layout">
24+
{{ if not .IsHome }}
25+
{{ if not (in .Params.display_breadcrumb "false" ) }}
26+
{{ partial "breadcrumb" .}}
27+
{{ end }}
28+
{{ end }}
29+
</section>
3030
<h1>{{ .Title }}</h1>
3131
{{ .Content }}
3232

0 commit comments

Comments
 (0)