fix(docs-infra): improve legibility and focus on content (#40427)

This commit changes the layout of the main content to improve
legibility, especially on wider screens:

- Limit main content width to 50em (800px by default).
- Center main content on the page.

Co-authored-by: Stefanie Fluin <sjtrimble@gmail.com>

PR Close #40427
This commit is contained in:
George Kalpakas 2021-02-02 14:35:44 +02:00 committed by Misko Hevery
parent 1e95c41069
commit 7379caa4b2
4 changed files with 19 additions and 9 deletions

View File

@ -102,13 +102,14 @@ a {
@include line-height(32); @include line-height(32);
font-weight: 400; font-weight: 400;
color: $darkgray; color: $darkgray;
& > em { & > em {
@include letter-spacing(0.3); @include letter-spacing(0.3);
} }
} }
p { p {
margin: 14px 0 0; margin: 1em 0;
} }
p + ul { p + ul {

View File

@ -6,6 +6,8 @@
.sidenav-content { .sidenav-content {
min-height: 100vh; min-height: 100vh;
padding: 80px 3rem 2rem; padding: 80px 3rem 2rem;
max-width: 50em;
margin: 0 auto;
@media screen and (max-width: 600px) { @media screen and (max-width: 600px) {
min-height: 450px; min-height: 450px;
@ -16,9 +18,15 @@
padding: 80px 1rem 1rem; padding: 80px 1rem 1rem;
} }
aio-shell.page-docs & { .page-about &,
// padding: 6rem 3rem 3rem 3rem; // THIS CAUSES THE TOP NAV TOOLBAR TO JUMP BETWEEN DOCS AND OTHER PAGES .page-contribute &,
margin: auto; .page-events &,
.page-features &,
.page-guide-cheatsheet &,
.page-home &,
.page-presskit &,
.page-resources & {
max-width: none;
} }
button { button {

View File

@ -13,6 +13,7 @@ footer {
& > * { & > * {
color: $white; color: $white;
max-width: 50em;
} }
} }
@ -56,7 +57,7 @@ footer {
p { p {
text-align: center; text-align: center;
margin: 10px 0px 5px; margin: 10px auto 5px;
@media (max-width: 480px) { @media (max-width: 480px) {
text-align: left; text-align: left;
@ -69,7 +70,7 @@ footer {
display: flex; display: flex;
justify-content: center; justify-content: center;
text-align: left; text-align: left;
margin: 0 0 40px; margin: 0 auto 40px;
ul { ul {
list-style-position: inside; list-style-position: inside;

View File

@ -262,13 +262,13 @@ section#intro {
aio-shell { aio-shell {
&.page-resources, &.page-events, &.page-features, &.page-presskit, &.page-contribute { &.page-resources, &.page-events, &.page-features, &.page-presskit, &.page-contribute {
main { .sidenav-content {
padding: 0rem 0rem 3rem; padding: 0 0 3rem;
} }
} }
&.page-home { &.page-home {
main { .sidenav-content {
padding: 0; padding: 0;
} }
} }