Skip to content

Commit a34d89a

Browse files
committed
feat: integrate typography api into all components
* Includes the base typography styles for headers, body text etc. * Adds mixins for typography next to the theme and moves out all of the component typography styles into them. * Switches all the hardcoded typography values to use the ones from the spec. * Adjusts the letter spacing on some of the headers to align them to the spec. **Note:** While going through the components, I haven't checked whether the styles are accurate in regards to the spec. I've left notes in the places where the font sizes weren't a part of the pre-defined ones.
1 parent 4021276 commit a34d89a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+376
-147
lines changed

src/demo-app/demo-app-module.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ import {PlatformDemo} from './platform/platform-demo';
4343
import {AutocompleteDemo} from './autocomplete/autocomplete-demo';
4444
import {InputDemo} from './input/input-demo';
4545
import {StyleDemo} from './style/style-demo';
46+
import {TypographyDemo} from './typography/typography-demo';
4647

4748

4849
@NgModule({
@@ -100,6 +101,7 @@ import {StyleDemo} from './style/style-demo';
100101
RainyTabContent,
101102
FoggyTabContent,
102103
PlatformDemo,
104+
TypographyDemo,
103105
],
104106
providers: [
105107
{provide: OverlayContainer, useClass: FullscreenOverlayContainer}

src/demo-app/demo-app/demo-app.html

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,14 @@
2525
</button>
2626
<div class="demo-toolbar">
2727
<h1>Angular Material Demos</h1>
28-
<button md-button (click)="toggleFullscreen()" title="Toggle fullscreen">
29-
Fullscreen
30-
</button>
31-
<button md-button (click)="root.dir = (root.dir == 'rtl' ? 'ltr' : 'rtl')" title="Toggle between RTL and LTR">
32-
{{root.dir.toUpperCase()}}
33-
</button>
28+
<div>
29+
<button md-button (click)="toggleFullscreen()" title="Toggle fullscreen">
30+
Fullscreen
31+
</button>
32+
<button md-button (click)="root.dir = (root.dir == 'rtl' ? 'ltr' : 'rtl')" title="Toggle between RTL and LTR">
33+
{{root.dir.toUpperCase()}}
34+
</button>
35+
</div>
3436
</div>
3537
</md-toolbar>
3638

src/demo-app/demo-app/demo-app.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ body {
3232
.demo-toolbar {
3333
display: flex;
3434
justify-content: space-between;
35+
align-items: center;
3536
width: 100%;
3637
}
3738
}

src/demo-app/demo-app/demo-app.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ export class DemoApp {
4848
{name: 'Toolbar', route: 'toolbar'},
4949
{name: 'Tooltip', route: 'tooltip'},
5050
{name: 'Platform', route: 'platform'},
51-
{name: 'Style', route: 'style'}
51+
{name: 'Style', route: 'style'},
52+
{name: 'Typography', route: 'typography'}
5253
];
5354

5455
constructor(private _element: ElementRef) {

src/demo-app/demo-app/routes.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import {PlatformDemo} from '../platform/platform-demo';
3232
import {AutocompleteDemo} from '../autocomplete/autocomplete-demo';
3333
import {InputDemo} from '../input/input-demo';
3434
import {StyleDemo} from '../style/style-demo';
35+
import {TypographyDemo} from '../typography/typography-demo';
3536

3637
export const DEMO_APP_ROUTES: Routes = [
3738
{path: '', component: Home},
@@ -66,4 +67,5 @@ export const DEMO_APP_ROUTES: Routes = [
6667
{path: 'snack-bar', component: SnackBarDemo},
6768
{path: 'platform', component: PlatformDemo},
6869
{path: 'style', component: StyleDemo},
70+
{path: 'typography', component: TypographyDemo},
6971
];

src/demo-app/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<link rel="icon" type="image/x-icon" href="favicon.ico">
1010
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
1111
<link href="dist/packages/material/core/theming/prebuilt/indigo-pink.css" rel="stylesheet">
12+
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500" rel="stylesheet">
1213

1314
<!-- FontAwesome for md-icon demo. -->
1415
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<h1 class="mat-h0">Lorem ipsum dolor sit amet.</h1>
2+
<h1 class="mat-h1">Lorem ipsum dolor sit amet, consectetur adipisicing.</h1>
3+
<h2 class="mat-h2">Lorem ipsum dolor sit amet, consectetur adipisicing.</h2>
4+
<h3 class="mat-h3">Lorem ipsum dolor sit amet, consectetur adipisicing.</h3>
5+
<h4 class="mat-h4">Lorem ipsum dolor sit amet, consectetur adipisicing.</h4>
6+
<h5 class="mat-h5">Lorem ipsum dolor sit amet, consectetur adipisicing.</h5>
7+
<h6 class="mat-h6">Lorem ipsum dolor sit amet, consectetur adipisicing.</h6>
8+
9+
<div class="mat-body">
10+
<p>Lorem ipsum dolor sit amet, <span class="mat-body-strong">consectetur</span> adipisicing elit. Iure voluptatem amet facilis rerum non dolore repellendus ab. Assumenda nisi perspiciatis odit illum voluptatem expedita laborum! Debitis nisi eius, ratione nostrum velit dignissimos molestias saepe, esse facilis blanditiis, labore optio. Accusantium, nihil illo est beatae nobis expedita animi libero, laboriosam excepturi consequatur eaque, ab repudiandae.</p>
11+
12+
<p>Inventore quaerat amet consectetur laudantium ipsa animi atque in fugit, quas magni dolorem, esse doloribus omnis nulla corporis laboriosam sint. Debitis sequi, reiciendis vitae perferendis eveniet quaerat distinctio aliquid laborum asperiores autem laboriosam ducimus quae, possimus, enim at unde facere porro. Optio totam cupiditate, molestiae esse voluptates maxime reprehenderit, nobis officia facere id temporibus dicta pariatur illo nihil quam dignissimos ipsa dolores numquam, libero ducimus nam. Aspernatur quae accusantium ipsa asperiores laboriosam illo molestiae explicabo rerum eum iusto, qui, voluptas praesentium!</p>
13+
14+
<p>Culpa dolor, velit ipsam ipsum alias, est, quam ab voluptatibus id repudiandae deserunt vel dolorem neque. Sapiente soluta fuga iste, adipisci dolores voluptate laudantium, nam praesentium quam similique non, id sit doloremque ex doloribus itaque esse culpa excepturi reprehenderit corporis? Sit, ducimus. Tempore non, maiores unde ut velit tenetur, vitae odit. Voluptate qui blanditiis atque odit nobis laborum nihil animi eligendi similique dolorum, tempore, error.</p>
15+
</div>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.mat-body {
2+
max-width: 800px;
3+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import {Component} from '@angular/core';
2+
3+
4+
@Component({
5+
moduleId: module.id,
6+
selector: 'typography-demo',
7+
templateUrl: 'typography-demo.html',
8+
styleUrls: ['typography-demo.css'],
9+
})
10+
export class TypographyDemo { }

src/lib/autocomplete/_autocomplete-theme.scss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,6 @@
1616
}
1717
}
1818

19-
}
19+
}
20+
21+
@mixin mat-autocomplete-typography($config) { }

0 commit comments

Comments
 (0)