Skip to content

Commit 82ced0c

Browse files
committed
4.4. Add MDC-based component to universal-app
Adds a couple examples of the MDC-based MatCheckbox to the universal app.
1 parent 2edb4c1 commit 82ced0c

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
1-
[MDC-based components go here]
1+
<h2>MDC checkbox</h2>
2+
3+
<mat-checkbox></mat-checkbox>
4+
<mat-checkbox checked></mat-checkbox>
5+
<mat-checkbox checked disabled></mat-checkbox>
6+
<mat-checkbox indeterminate></mat-checkbox>
7+
<mat-checkbox>with a label</mat-checkbox>

src/universal-app/kitchen-sink-mdc/kitchen-sink-mdc.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import {Component, NgModule} from '@angular/core';
2+
import {MatCheckboxModule} from '@angular/material-experimental/mdc-checkbox';
23

34
@Component({
45
selector: 'kitchen-sink-mdc',
@@ -8,6 +9,9 @@ export class KitchenSinkMdc {
89
}
910

1011
@NgModule({
12+
imports: [
13+
MatCheckboxModule,
14+
],
1115
declarations: [KitchenSinkMdc],
1216
exports: [KitchenSinkMdc],
1317
})

src/universal-app/theme.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
@import '../lib/core/theming/all-theme';
2+
@import '../material-experimental/mdc-checkbox/mdc-checkbox';
3+
@import '../material-experimental/mdc-helpers/mdc-helpers';
24

35
// Plus imports for other components in your app.
46

57
// Include the common styles for Angular Material. We include this here so that you only
68
// have to load a single css file for Angular Material in your app.
79
// **Be sure that you only ever include this mixin once!**
810
@include mat-core();
11+
@include mat-checkbox-typography-mdc(mat-typography-config());
912

1013
// Define the default theme (same as the example above).
1114
$candy-app-primary: mat-palette($mat-indigo);
@@ -14,3 +17,4 @@ $candy-app-theme: mat-light-theme($candy-app-primary, $candy-app-accent);
1417

1518
// Include the default theme styles.
1619
@include angular-material-theme($candy-app-theme);
20+
@include mat-checkbox-theme-mdc($candy-app-theme);

0 commit comments

Comments
 (0)