docs(docs-infra): fix the global layout of the site (#58831)

take the full width of the page for all the pages that use docs-viewer, also reserve an area for table of contents on-demand

Resolves: #52648

PR Close #58831
This commit is contained in:
ahmadhakeem18 2024-11-22 12:30:47 -08:00 committed by Alex Rickabaugh
parent f0dd8f8769
commit f9932e8b0d
7 changed files with 7 additions and 12 deletions

View file

@ -2,7 +2,7 @@
display: flex;
flex-direction: column;
position: fixed;
right: 16px;
right: 1rem;
top: 0;
height: fit-content;
width: 14rem;

View file

@ -9,19 +9,17 @@
display: flex;
flex-direction: column;
padding: var(--layout-padding);
max-width: var(--page-width);
width: 100%;
box-sizing: border-box;
@media only screen and (max-width: 1430px) {
container: docs-content / inline-size;
}
// If rendered on the docs page, accommodate width for TOC
docs-docs & {
@media only screen and (min-width: 1430px) and (max-width: 1550px) {
width: calc(100% - 195px - var(--layout-padding));
max-width: var(--page-width);
// check if TOC component present in the page and has more than one elenment
&.docs-with-TOC:has(docs-table-of-contents ul > li:nth-child(2)) {
@media only screen and (min-width: 1430px) {
// take the available space except a reserved area for TOC
max-width: calc(100% - 17rem);
}
}

View file

@ -60,6 +60,7 @@ export const GITHUB_CONTENT_URL = 'https://github.com/angular/angular/blob/main/
encapsulation: ViewEncapsulation.None,
host: {
'[class.docs-animate-content]': 'animateContent',
'[class.docs-with-TOC]': 'hasToc',
},
})
export class DocViewer implements OnChanges {

View file

@ -6,7 +6,6 @@
.docs-decorative-header {
border-radius: 0.625rem;
background: var(--septenary-contrast);
max-width: var(--page-width);
overflow: hidden;
display: flex;
position: relative;

View file

@ -1,6 +1,5 @@
:host {
padding: var(--layout-padding);
max-width: var(--page-width);
display: block;
container: api-ref-page / inline-size;

View file

@ -67,7 +67,6 @@ $column-width: calc(50% - #{$resizer-width} - var(--layout-padding));
}
.docs-tutorial-content {
max-width: var(--page-width);
min-width: 300px;
width: 100%;
box-sizing: content-box;

View file

@ -1,6 +1,5 @@
.page {
padding: var(--layout-padding);
max-width: var(--page-width);
container: update-guide-page / inline-size;
}