Skip to content

Commit cebfe51

Browse files
committed
build: fix typography demo
Fixes that the demo for the typography wasn't working. Also makes it easier to compare legacy and non-legacy typographies.
1 parent 2a8bc66 commit cebfe51

File tree

4 files changed

+18
-6
lines changed

4 files changed

+18
-6
lines changed

src/dev-app/theme.scss

+3
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ $candy-app-theme: mat.define-light-theme((
2929
@include experimental.column-resize-theme($candy-app-theme);
3030
@include experimental.popover-edit-theme($candy-app-theme);
3131

32+
@include mat.legacy-typography-hierarchy($candy-app-theme, '.mat-legacy-typography');
33+
@include mat.typography-hierarchy($candy-app-theme);
34+
3235
.demo-strong-focus {
3336
// Note: we can theme the indicators directly through `strong-focus-indicators` as well.
3437
// Use the theme so we have some coverage over the entire API surface.

src/dev-app/typography/BUILD.bazel

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ng_module(
1010
":typography_demo_scss",
1111
],
1212
deps = [
13+
"//src/material/checkbox",
14+
"@npm//@angular/forms",
1315
],
1416
)
1517

src/dev-app/typography/typography-demo.html

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
<mat-checkbox [(ngModel)]="isLegacy">Is Legacy</mat-checkbox>
2+
13
<!-- via https://en.wikipedia.org/wiki/Pangram -->
2-
<div class="mat-typography">
3-
<h1 class="mat-display-4">How vexingly quick daft zebras jump!</h1>
4-
<h1 class="mat-display-3">The wizard quickly jinxed the gnomes before they vaporized.</h1>
5-
<h1 class="mat-display-2">The quick brown fox jumps over the lazy dog.</h1>
6-
<h1 class="mat-display-1">Grumpy wizards make toxic brew for the evil queen and jack.</h1>
4+
<div [class]="isLegacy ? 'mat-legacy-typography' : 'mat-typography'">
5+
<h1 [class]="isLegacy ? 'mat-display-4' : 'mat-headline-1'">How vexingly quick daft zebras jump!</h1>
6+
<h1 [class]="isLegacy ? 'mat-display-3' : 'mat-headline-2'">The wizard quickly jinxed the gnomes before they vaporized.</h1>
7+
<h1 [class]="isLegacy ? 'mat-display-2' : 'mat-headline-3'">The quick brown fox jumps over the lazy dog.</h1>
8+
<h1 [class]="isLegacy ? 'mat-display-1' : 'mat-headline-4'">Grumpy wizards make toxic brew for the evil queen and jack.</h1>
79
<h1>Jackdaws love my big sphinx of quartz.</h1>
810
<h2>The five boxing wizards jump quickly.</h2>
911
<h3>Pack my box with five dozen liquor jugs.</h3>

src/dev-app/typography/typography-demo.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,16 @@
77
*/
88

99
import {Component} from '@angular/core';
10+
import {MatCheckboxModule} from '@angular/material/checkbox';
11+
import {FormsModule} from '@angular/forms';
1012

1113
@Component({
1214
selector: 'typography-demo',
1315
templateUrl: 'typography-demo.html',
1416
styleUrls: ['typography-demo.css'],
17+
imports: [MatCheckboxModule, FormsModule],
1518
standalone: true,
1619
})
17-
export class TypographyDemo {}
20+
export class TypographyDemo {
21+
isLegacy = false;
22+
}

0 commit comments

Comments
 (0)