Skip to content
This repository was archived by the owner on Dec 18, 2024. It is now read-only.

Commit ad1400e

Browse files
willshowelljelbourn
authored andcommitted
Set max width for component and guide viewers (#207)
1 parent ac3f30e commit ad1400e

File tree

5 files changed

+42
-23
lines changed

5 files changed

+42
-23
lines changed
Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
<!-- TODO(jelbourn): turn this into nav tabs -->
2-
<nav md-tab-nav-bar class="docs-component-viewer-tabbed-content">
3-
<a md-tab-link class="docs-component-viewer-section-tab"
4-
*ngFor="let section of ['Overview', 'API', 'Examples']"
5-
[routerLink]="section.toLowerCase()"
6-
routerLinkActive #rla="routerLinkActive"
7-
[active]="rla.isActive">{{section}}</a>
8-
</nav>
1+
<div class="docs-component-viewer">
2+
<nav md-tab-nav-bar class="docs-component-viewer-tabbed-content">
3+
<a md-tab-link class="docs-component-viewer-section-tab"
4+
*ngFor="let section of ['Overview', 'API', 'Examples']"
5+
[routerLink]="section.toLowerCase()"
6+
routerLinkActive #rla="routerLinkActive"
7+
[active]="rla.isActive">{{section}}</a>
8+
</nav>
99

10-
<div class="docs-component-viewer-content">
11-
<router-outlet></router-outlet>
10+
<div class="docs-component-viewer-content">
11+
<router-outlet></router-outlet>
12+
</div>
1213
</div>

src/app/pages/component-viewer/component-viewer.scss

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,17 @@
22

33
app-component-viewer {
44
font-weight: 400;
5-
margin: 20px 70px 50px 70px;
5+
padding: 20px $content-padding-side 50px;
6+
7+
@media ($mat-xsmall) {
8+
padding-left: $content-padding-side-xs;
9+
padding-right: $content-padding-side-xs;
10+
}
11+
}
12+
13+
.docs-component-viewer {
14+
margin: 0 auto;
15+
max-width: 940px;
616
}
717

818
.docs-component-viewer-section-tab {

src/app/pages/guide-viewer/guide-viewer.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
<h1>{{guide.name}}</h1>
33
</div>
44

5-
<doc-viewer class="docs-guide-content" [documentUrl]="guide.document"></doc-viewer>
5+
<div class="docs-guide-wrapper">
6+
<doc-viewer class="docs-guide-content" [documentUrl]="guide.document"></doc-viewer>
7+
</div>
68

79
<app-footer></app-footer>
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
@import "../../../../node_modules/@angular/material/theming";
2-
3-
/* For desktop, the content should be aligned with the page title. */
4-
$guide-content-margin-side: 70px;
5-
$guide-content-margin-side-xs: 15px;
1+
@import '../../../styles/constants';
62

73
:host {
84
display: flex;
95
flex-direction: column;
106
flex-grow: 1;
117
}
128

13-
.docs-guide-content {
14-
display: block;
15-
margin: 20px $guide-content-margin-side 0;
16-
flex-grow: 1;
9+
.docs-guide-wrapper {
10+
padding: 20px $content-padding-side 0;
1711

1812
@media ($mat-xsmall) {
19-
margin-left: $guide-content-margin-side-xs;
20-
margin-right: $guide-content-margin-side-xs;
13+
padding-left: $content-padding-side-xs;
14+
padding-right: $content-padding-side-xs;
2115
}
2216
}
17+
18+
.docs-guide-content {
19+
display: block;
20+
margin: 0 auto;
21+
max-width: 940px;
22+
}

src/styles/_constants.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
1+
@import '../../node_modules/@angular/material/theming';
2+
13
$small-breakpoint-width: 840px;
4+
5+
/* For desktop, the content should be aligned with the page title. */
6+
$content-padding-side: 70px;
7+
$content-padding-side-xs: 15px;

0 commit comments

Comments
 (0)