0
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-01-18 10:52:19 +01:00

docs(layout): ensure content sits in main (#31610)

Co-authored-by: XhmikosR <xhmikosr@gmail.com>
This commit is contained in:
Gaël Poupard 2020-09-10 11:33:11 +02:00 committed by GitHub
parent cbe4daff6f
commit 28a92234e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 51 additions and 35 deletions

View File

@ -2,20 +2,12 @@
@include media-breakpoint-up(md) {
display: grid;
gap: $grid-gutter-width;
grid-template-areas:
"sidebar intro"
"sidebar toc"
"sidebar content";
grid-template-areas: "sidebar main";
grid-template-columns: 1fr 3fr;
grid-template-rows: auto auto 1fr;
}
@include media-breakpoint-up(lg) {
grid-template-areas:
"sidebar intro toc"
"sidebar content toc";
grid-template-columns: 1fr 4fr 1fr;
grid-template-rows: auto 1fr;
grid-template-columns: 1fr 5fr;
}
}
@ -23,6 +15,28 @@
grid-area: sidebar;
}
.bd-main {
grid-area: main;
@include media-breakpoint-up(md) {
display: grid;
gap: inherit;
grid-template-areas:
"intro"
"toc"
"content";
grid-template-rows: auto auto 1fr;
}
@include media-breakpoint-up(lg) {
grid-template-areas:
"intro toc"
"content toc";
grid-template-columns: 4fr 1fr;
grid-template-rows: auto 1fr;
}
}
.bd-intro {
grid-area: intro;
}

View File

@ -10,10 +10,11 @@
{{ partial "docs-subnav" . }}
<div class="container-xxl my-4 bd-layout">
<div class="bd-sidebar">
<aside class="bd-sidebar">
{{ partial "docs-sidebar" . }}
</div>
</aside>
<main class="bd-main order-1">
<div class="bd-intro pt-md-3 pl-lg-4">
<div class="d-md-flex flex-md-row-reverse align-items-center justify-content-between">
<a class="btn btn-sm btn-bd-light mb-2 mb-md-0" href="{{ .Site.Params.repo }}/tree/main/site/content/{{ .Page.File.Path }}" title="View and edit this file on GitHub" target="_blank" rel="noopener">View on GitHub</a>
@ -30,7 +31,7 @@
</div>
{{ end }}
<main class="bd-content order-1 pl-lg-4">
<div class="bd-content pl-lg-4">
{{ if .Page.Params.sections }}
<div class="row g-3">
{{ range .Page.Params.sections }}
@ -45,6 +46,7 @@
{{ end }}
{{ .Content }}
</div>
</main>
</div>