Skip to content

Commit 0de3f72

Browse files
authored
fix(material-experimental/mdc-slider): expose theming mixins (#22764)
* Fixes that the MDC slider wasn't exposing its theming mixins publicly. * Updates the docs for the MDC button to the new theming API.
1 parent 2dc9949 commit 0de3f72

File tree

2 files changed

+18
-17
lines changed

2 files changed

+18
-17
lines changed

src/material-experimental/_index.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@
6060
mdc-select-density, mdc-select-theme;
6161
@forward './mdc-slide-toggle/slide-toggle-theme' as mdc-slide-toggle-* show mdc-slide-toggle-color,
6262
mdc-slide-toggle-typography, mdc-slide-toggle-density, mdc-slide-toggle-theme;
63+
@forward './mdc-slider/slider-theme' as mdc-slider-* show mdc-slider-color,
64+
mdc-slider-typography, mdc-slider-density, mdc-slider-theme;
6365
@forward './mdc-snack-bar/snack-bar-theme' as mdc-snack-bar-* show mdc-snack-bar-color,
6466
mdc-snack-bar-typography, mdc-snack-bar-density, mdc-snack-bar-theme;
6567
@forward './mdc-table/table-theme' as mdc-table-* show mdc-table-color, mdc-table-typography,

src/material-experimental/mdc-button/README.md

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ This is a prototype of an alternate version of `MatButton` built on top of
33
experimental and should not be used in production.
44

55
## How to use
6-
Assuming your application is already up and running using Angular Material, you can add this
6+
Assuming your application is already up and running using Angular Material, you can add this
77
component by following these steps:
88

99
1. Install `@angular/material-experimental` and MDC Web:
@@ -41,41 +41,40 @@ component by following these steps:
4141
```
4242

4343
4. Use the buttons in your component's template:
44-
45-
```html
44+
45+
```html
4646
<button mat-button> Basic </button>
4747
<button mat-raised-button> Raised </button>
4848
<button mat-stroked-button> Stroked </button>
49-
<button mat-flat-button> Flat </button>
49+
<button mat-flat-button> Flat </button>
5050
<button mat-icon-button>
5151
<mat-icon>save</mat-icon>
5252
</button>
5353
<button mat-fab>
5454
<mat-icon>add</mat-icon>
5555
</button>
56-
```
57-
58-
5. Add the theme and typography mixins to your Sass. Note that there are three separate mixins for
59-
the button variants: standard buttons, icon buttons, and floating action buttons. Include only the mixins of the
56+
```
57+
58+
5. Add the theme and typography mixins to your Sass. Note that there are three separate mixins for
59+
the button variants: standard buttons, icon buttons, and floating action buttons. Include only the mixins of the
6060
button variants you are using:
6161

6262
```scss
63-
@import '~@angular/material/theming';
64-
@import '~@angular/material-experimental/mdc-button/button-theme';
63+
@use '~@angular/material' as mat;
64+
@use '~@angular/material-experimental' as mat-experimental;
6565

66-
$candy-app-primary: mat-palette($mat-indigo);
67-
$candy-app-accent: mat-palette($mat-pink, A200, A100, A400);
68-
$candy-app-theme: mat-light-theme((
66+
$candy-app-primary: mat.define-palette(mat.$indigo-palette);
67+
$candy-app-accent: mat.define-palette(mat.$pink-palette, A200, A100, A400);
68+
$candy-app-theme: mat.define-light-theme((
6969
color: (
7070
primary: $candy-app-primary,
7171
accent: $candy-app-accent,
7272
)
7373
));
7474

75-
76-
@include mat-mdc-button-theme($candy-app-theme);
77-
@include mat-mdc-fab-theme($candy-app-theme);
78-
@include mat-mdc-icon-button-theme($candy-app-theme);
75+
@include mat-experimental.mdc-button-theme($candy-app-theme);
76+
@include mat-experimental.mdc-fab-theme($candy-app-theme);
77+
@include mat-experimental.mdc-icon-button-theme($candy-app-theme);
7978
```
8079

8180
## API differences

0 commit comments

Comments
 (0)