Skip to content

Commit 0f8e887

Browse files
authored
docs(material/progress-spinner): Update description and examples for color input description on API page (#29332)
1 parent e254b2f commit 0f8e887

File tree

4 files changed

+14
-25
lines changed

4 files changed

+14
-25
lines changed

src/components-examples/material/progress-spinner/progress-spinner-configurable/progress-spinner-configurable-example.html

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,6 @@
22
<mat-card-content>
33
<h2 class="example-h2">Progress spinner configuration</h2>
44

5-
<section class="example-section">
6-
<label class="example-margin">Color:</label>
7-
<mat-radio-group [(ngModel)]="color">
8-
<mat-radio-button class="example-margin" value="primary">
9-
Primary
10-
</mat-radio-button>
11-
<mat-radio-button class="example-margin" value="accent">
12-
Accent
13-
</mat-radio-button>
14-
<mat-radio-button class="example-margin" value="warn">
15-
Warn
16-
</mat-radio-button>
17-
</mat-radio-group>
18-
</section>
19-
205
<section class="example-section">
216
<label class="example-margin">Mode:</label>
227
<mat-radio-group [(ngModel)]="mode">
@@ -46,7 +31,6 @@ <h2 class="example-h2">Result</h2>
4631

4732
<mat-progress-spinner
4833
class="example-margin"
49-
[color]="color"
5034
[mode]="mode"
5135
[value]="value">
5236
</mat-progress-spinner>

src/components-examples/material/progress-spinner/progress-spinner-configurable/progress-spinner-configurable-example.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import {Component} from '@angular/core';
2-
import {ThemePalette} from '@angular/material/core';
32
import {ProgressSpinnerMode, MatProgressSpinnerModule} from '@angular/material/progress-spinner';
43
import {MatSliderModule} from '@angular/material/slider';
54
import {FormsModule} from '@angular/forms';
@@ -17,7 +16,6 @@ import {MatCardModule} from '@angular/material/card';
1716
imports: [MatCardModule, MatRadioModule, FormsModule, MatSliderModule, MatProgressSpinnerModule],
1817
})
1918
export class ProgressSpinnerConfigurableExample {
20-
color: ThemePalette = 'primary';
2119
mode: ProgressSpinnerMode = 'determinate';
2220
value = 50;
2321
}

src/material/progress-spinner/progress-spinner.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,6 @@ which can be a whole number between 0 and 100.
1717

1818
In "indeterminate" mode, the `value` property is ignored.
1919

20-
21-
### Theming
22-
The color of a progress-spinner can be changed by using the `color` property. By default,
23-
progress-spinners use the theme's primary color. This can be changed to `'accent'` or `'warn'`.
24-
2520
### Accessibility
2621

2722
`MatLegacyProgressSpinner` implements the ARIA `role="progressbar"` pattern. By default, the spinner

src/material/progress-spinner/progress-spinner.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,13 @@ export type ProgressSpinnerMode = 'determinate' | 'indeterminate';
2727

2828
/** Default `mat-progress-spinner` options that can be overridden. */
2929
export interface MatProgressSpinnerDefaultOptions {
30-
/** Default color of the spinner. */
30+
/**
31+
* Default theme color of the progress spinner. This API is supported in M2 themes only, it
32+
* 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+
*/
3137
color?: ThemePalette;
3238
/** Diameter of the spinner. */
3339
diameter?: number;
@@ -95,7 +101,13 @@ export class MatProgressSpinner {
95101
_noopAnimations: boolean;
96102

97103
// TODO: should be typed as `ThemePalette` but internal apps pass in arbitrary strings.
98-
/** Theme palette color of the progress spinner. */
104+
/**
105+
* Theme color of the progress spinner. This API is supported in M2 themes only, it
106+
* has no effect in M3 themes.
107+
*
108+
* For information on applying color variants in M3, see
109+
* https://material.angular.io/guide/theming#using-component-color-variants.
110+
*/
99111
@Input()
100112
get color() {
101113
return this._color || this._defaultColor;

0 commit comments

Comments
 (0)