Skip to content

Commit 8339155

Browse files
committed
docs: remove color property from remaining examples and overview pages and make description comment consistent across components (#29345)
(cherry picked from commit e9d1c7a)
1 parent e5c5f15 commit 8339155

File tree

11 files changed

+34
-41
lines changed

11 files changed

+34
-41
lines changed

src/components-examples/material/expansion/expansion-steps/expansion-steps-example.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
</mat-form-field>
2020
<!-- #docregion action-bar -->
2121
<mat-action-row>
22-
<button mat-button color="primary" (click)="nextStep()">Next</button>
22+
<button mat-button (click)="nextStep()">Next</button>
2323
</mat-action-row>
2424
<!-- #enddocregion action-bar -->
2525
</mat-expansion-panel>
@@ -39,8 +39,8 @@
3939
</mat-form-field>
4040

4141
<mat-action-row>
42-
<button mat-button color="warn" (click)="prevStep()">Previous</button>
43-
<button mat-button color="primary" (click)="nextStep()">Next</button>
42+
<button mat-button (click)="prevStep()">Previous</button>
43+
<button mat-button (click)="nextStep()">Next</button>
4444
</mat-action-row>
4545
</mat-expansion-panel>
4646

@@ -60,8 +60,8 @@
6060
<mat-datepicker #picker></mat-datepicker>
6161

6262
<mat-action-row>
63-
<button mat-button color="warn" (click)="prevStep()">Previous</button>
64-
<button mat-button color="primary" (click)="nextStep()">End</button>
63+
<button mat-button (click)="prevStep()">Previous</button>
64+
<button mat-button (click)="nextStep()">End</button>
6565
</mat-action-row>
6666
</mat-expansion-panel>
6767
</mat-accordion>

src/components-examples/material/sidenav/sidenav-responsive/sidenav-responsive-example.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@if (shouldRun) {
22
<div class="example-container" [class.example-is-mobile]="mobileQuery.matches">
3-
<mat-toolbar color="primary" class="example-toolbar">
3+
<mat-toolbar class="example-toolbar">
44
<button mat-icon-button (click)="snav.toggle()"><mat-icon>menu</mat-icon></button>
55
<h1 class="example-app-name">Responsive App</h1>
66
</mat-toolbar>

src/material/badge/badge.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,11 @@ export class _MatBadgeStyleLoader {}
8484
})
8585
export class MatBadge implements OnInit, OnDestroy {
8686
/**
87-
* The color of the badge. Can be `primary`, `accent`, or `warn`.
88-
* Not recommended in M3, for more information see https://material.angular.io/guide/material-2-theming#optional-add-backwards-compatibility-styles-for-color-variants.
87+
* Theme color of the badge. This API is supported in M2 themes only, it
88+
* has no effect in M3 themes.
89+
*
90+
* For information on applying color variants in M3, see
91+
* https://material.angular.io/guide/theming#using-component-color-variants.
8992
*/
9093
@Input('matBadgeColor')
9194
get color(): ThemePalette {

src/material/button/fab.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ import {ThemePalette} from '@angular/material/core';
2727

2828
/** Default FAB options that can be overridden. */
2929
export interface MatFabDefaultOptions {
30+
/**
31+
* Default theme color of the button. This API is supported in M2 themes
32+
* only, it has no effect in M3 themes.
33+
*
34+
* For information on applying color variants in M3, see
35+
* https://material.angular.io/guide/theming#using-component-color-variants
36+
*/
3037
color?: ThemePalette;
3138
}
3239

src/material/checkbox/checkbox-config.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@ import {ThemePalette} from '@angular/material/core';
1111
/** Default `mat-checkbox` options that can be overridden. */
1212
export interface MatCheckboxDefaultOptions {
1313
/**
14-
* Default theme color palette to be used for checkboxes. This API is supported in M2 themes
15-
* only, it has no effect in M3 themes. For information on applying color variants in M3, see
14+
* Default theme color of the checkbox. This API is supported in M2 themes
15+
* only, it has no effect in M3 themes.
16+
*
17+
* For information on applying color variants in M3, see
1618
* https://material.angular.io/guide/theming#using-component-color-variants
1719
*/
1820
color?: ThemePalette;

src/material/checkbox/checkbox.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,6 @@ Default behavior of `mat-checkbox`. Always set `indeterminate` to `false`
5858
when user click on the `mat-checkbox`.
5959
This matches the behavior of native `<input type="checkbox">`.
6060

61-
### Theming
62-
63-
The color of a `<mat-checkbox>` can be changed by specifying a `$color-variant` when applying the
64-
`mat.checkbox-theme` or `mat.checkbox-color` mixins (see the
65-
[theming guide](/guide/theming#using-component-color-variants) to learn more.) By default,
66-
checkboxes use the theme's primary palette. This can be changed to `'secondary'`, `'tertiary'`,
67-
or `'error'`.
68-
6961
### Accessibility
7062

7163
`MatCheckbox` uses an internal `<input type="checkbox">` to provide an accessible experience.

src/material/chips/chips.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -114,14 +114,6 @@ Use the `MAT_CHIPS_DEFAULT_OPTIONS` token to specify default options for the chi
114114
})
115115
```
116116

117-
### Theming
118-
119-
The color of a `<mat-datepicker>` can be changed by specifying a `$color-variant` when applying the
120-
`mat.datepicker-theme` or `mat.datepicker-color` mixins (see the
121-
[theming guide](/guide/theming#using-component-color-variants) to learn more.) By default, the
122-
datepicker uses the theme's primary palette. This can be changed to `'secondary'`, `'tertiary'`,
123-
or `'error'`.
124-
125117
### Interaction Patterns
126118

127119
The chips components support 3 user interaction patterns, each with its own container and chip elements:

src/material/datepicker/datepicker-base.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,9 @@ export interface MatDatepickerPanel<
325325
closedStream: EventEmitter<void>;
326326
/**
327327
* Color palette to use on the datepicker's calendar. This API is supported in M2 themes only, it
328-
* has no effect in M3 themes. For information on applying color variants in M3, see
328+
* has no effect in M3 themes.
329+
*
330+
* For information on applying color variants in M3, see
329331
* https://material.angular.io/guide/theming#using-component-color-variants
330332
*/
331333
color: ThemePalette;
@@ -379,9 +381,11 @@ export abstract class MatDatepickerBase<
379381
@Input() startView: 'month' | 'year' | 'multi-year' = 'month';
380382

381383
/**
382-
* Color palette to use on the datepicker's calendar. This API is supported in M2 themes only, it
383-
* has no effect in M3 themes. For information on applying color variants in M3, see
384-
* https://material.angular.io/guide/theming#using-component-color-variants
384+
* Theme color of the datepicker's calendar. This API is supported in M2 themes only, it
385+
* has no effect in M3 themes.
386+
*
387+
* For information on applying color variants in M3, see
388+
* https://material.angular.io/guide/theming#using-component-color-variants.
385389
*/
386390
@Input()
387391
get color(): ThemePalette {

src/material/datepicker/datepicker.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -131,14 +131,6 @@ As with other types of `<input>`, the datepicker works with `@angular/forms` dir
131131

132132
<!-- example(datepicker-value) -->
133133

134-
### Changing the datepicker colors
135-
136-
The color of the datepicker can be changed by specifying a `$color-variant` when applying the
137-
`mat.datepicker-theme` or `mat.datepicker-color` mixins (see the
138-
[theming guide](/guide/theming#using-component-color-variants) to learn more.) By default, the
139-
datepicker uses the theme's primary palette. This can be changed to `'secondary'`, `'tertiary'`, or
140-
`'error'`.
141-
142134
### Date validation
143135

144136
There are three properties that add date validation to the datepicker input. The first two are the

src/material/form-field/form-field.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,10 @@ export interface MatFormFieldDefaultOptions {
7373
/** Default form field appearance style. */
7474
appearance?: MatFormFieldAppearance;
7575
/**
76-
* Default color of the form field. This API is supported in M2 themes only, it has no effect in
77-
* M3 themes. For information on applying color variants in M3, see
76+
* Default theme color of the form field. This API is supported in M2 themes only, it has no
77+
* effect in M3 themes.
78+
*
79+
* For information on applying color variants in M3, see
7880
* https://material.angular.io/guide/theming#using-component-color-variants
7981
*/
8082
color?: ThemePalette;

tools/public_api_guard/material/button.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ export class MatFabButton extends MatButtonBase {
9292

9393
// @public
9494
export interface MatFabDefaultOptions {
95-
// (undocumented)
9695
color?: ThemePalette;
9796
}
9897

0 commit comments

Comments
 (0)