Skip to content

Commit fd210d7

Browse files
committed
docs(multiple): Update color input comments to standarize across the components (#29254)
(cherry picked from commit 27503ed)
1 parent d11a8af commit fd210d7

File tree

13 files changed

+89
-22
lines changed

13 files changed

+89
-22
lines changed

src/material/button/button-base.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,11 @@ export class MatButtonBase implements AfterViewInit, OnDestroy {
108108
}
109109

110110
/**
111-
* Theme color palette of the button. This API is supported in M2 themes
112-
* only, it has no effect in M3 themes.
111+
* Theme color of the button. This API is supported in M2 themes only, it has
112+
* no effect in M3 themes.
113113
*
114114
* For information on applying color variants in M3, see
115-
* https://material.angular.io/guide/theming#using-component-color-variants
115+
* https://material.angular.io/guide/theming#using-component-color-variants.
116116
*/
117117
@Input() color?: string | null;
118118

src/material/checkbox/checkbox.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,11 @@ export class MatCheckbox
203203
// TODO(crisbeto): this should be a ThemePalette, but some internal apps were abusing
204204
// the lack of type checking previously and assigning random strings.
205205
/**
206-
* Palette color of the checkbox. This API is supported in M2 themes only, it has no effect in M3
207-
* themes. For information on applying color variants in M3, see
208-
* https://material.angular.io/guide/theming#using-component-color-variants
206+
* Theme color of the checkbox. This API is supported in M2 themes only, it
207+
* has no effect in M3 themes.
208+
*
209+
* For information on applying color variants in M3, see
210+
* https://material.angular.io/guide/theming#using-component-color-variants.
209211
*/
210212
@Input() color: string | undefined;
211213

src/material/chips/chip.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,11 @@ export class MatChip implements OnInit, AfterViewInit, AfterContentInit, DoCheck
173173

174174
// TODO: should be typed as `ThemePalette` but internal apps pass in arbitrary strings.
175175
/**
176-
* Theme color palette of the chip. This API is supported in M2 themes only, it has no effect in
177-
* M3 themes. For information on applying color variants in M3, see
178-
* https://material.angular.io/guide/theming#using-component-color-variants
176+
* Theme color of the chip. This API is supported in M2 themes only, it has no
177+
* effect in M3 themes.
178+
*
179+
* For information on applying color variants in M3, see
180+
* https://material.angular.io/guide/theming#using-component-color-variants.
179181
*/
180182
@Input() color?: string | null;
181183

src/material/datepicker/datepicker-base.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,13 @@ export class MatDatepickerContent<S, D = ExtractDateTypeFromSelection<S>>
145145
/** Reference to the internal calendar component. */
146146
@ViewChild(MatCalendar) _calendar: MatCalendar<D>;
147147

148-
/** Palette color of the internal calendar. */
148+
/**
149+
* Theme color of the internal calendar. This API is supported in M2 themes
150+
* only, it has no effect in M3 themes.
151+
*
152+
* For information on applying color variants in M3, see
153+
* https://material.angular.io/guide/theming#using-component-color-variants.
154+
*/
149155
@Input() color: ThemePalette;
150156

151157
/** Reference to the datepicker that created the overlay. */

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,11 @@ export class MatFormField
213213
private _hideRequiredMarker = false;
214214

215215
/**
216-
* The color palette for the form field. This API is supported in M2 themes only, it has no
217-
* effect in M3 themes. For information on applying color variants in M3, see
218-
* https://material.angular.io/guide/theming#using-component-color-variants
216+
* Theme color of the form field. This API is supported in M2 themes only, it
217+
* has no effect in M3 themes.
218+
*
219+
* For information on applying color variants in M3, see
220+
* https://material.angular.io/guide/theming#using-component-color-variants.
219221
*/
220222
@Input() color: ThemePalette = 'primary';
221223

src/material/list/selection-list.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,14 @@ export class MatSelectionList
9393
@Output() readonly selectionChange: EventEmitter<MatSelectionListChange> =
9494
new EventEmitter<MatSelectionListChange>();
9595

96-
/** Theme color of the selection list. This sets the checkbox color for all list options. */
96+
/**
97+
* Theme color of the selection list. This sets the checkbox color for all
98+
* list options. This API is supported in M2 themes only, it has no effect in
99+
* M3 themes.
100+
*
101+
* For information on applying color variants in M3, see
102+
* https://material.angular.io/guide/theming#using-component-color-variants.
103+
*/
97104
@Input() color: ThemePalette = 'accent';
98105

99106
/**

src/material/paginator/paginator.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,13 @@ export class MatPaginator implements OnInit, OnDestroy {
122122
private _isInitialized = false;
123123
private _initializedStream = new ReplaySubject<void>(1);
124124

125-
/** Theme color to be used for the underlying form controls. */
125+
/**
126+
* Theme color of the underlying form controls. This API is supported in M2
127+
* themes only,it has no effect in M3 themes.
128+
*
129+
* For information on applying color variants in M3, see
130+
* https://material.angular.io/guide/theming#using-component-color-variants.
131+
*/
126132
@Input() color: ThemePalette;
127133

128134
/** The zero-based page index of the displayed list of items. Defaulted to 0. */

src/material/radio/radio.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,13 @@ export class MatRadioGroup implements AfterContentInit, OnDestroy, ControlValueA
152152
@ContentChildren(forwardRef(() => MatRadioButton), {descendants: true})
153153
_radios: QueryList<MatRadioButton>;
154154

155-
/** Theme color for all of the radio buttons in the group. */
155+
/**
156+
* Theme color of the radio buttons in the group. This API is supported in M2
157+
* themes only, it has no effect in M3 themes.
158+
*
159+
* For information on applying color variants in M3, see
160+
* https://material.angular.io/guide/theming#using-component-color-variants.
161+
*/
156162
@Input() color: ThemePalette;
157163

158164
/** Name of the radio button group. All radio buttons inside this group will use this name. */

src/material/slide-toggle/slide-toggle.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,13 @@ export class MatSlideToggle
155155

156156
// TODO(crisbeto): this should be a ThemePalette, but some internal apps were abusing
157157
// the lack of type checking previously and assigning random strings.
158-
/** Palette color of slide toggle. */
158+
/**
159+
* Theme color of the slide toggle. This API is supported in M2 themes only,
160+
* it has no effect in M3 themes.
161+
*
162+
* For information on applying color variants in M3, see
163+
* https://material.angular.io/guide/theming#using-component-color-variants.
164+
*/
159165
@Input() color: string | undefined;
160166

161167
/** Whether the slide toggle is disabled. */

src/material/stepper/step-header.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,13 @@ export class MatStepHeader extends CdkStepHeader implements AfterViewInit, OnDes
7171
/** Whether the ripple should be disabled. */
7272
@Input() disableRipple: boolean;
7373

74-
/** Theme palette color of the step header. */
74+
/**
75+
* Theme color of the step header. This API is supported in M2 themes only, it
76+
* has no effect in M3 themes.
77+
*
78+
* For information on applying color variants in M3, see
79+
* https://material.angular.io/guide/theming#using-component-color-variants.
80+
*/
7581
@Input() color: ThemePalette;
7682

7783
constructor(

src/material/stepper/stepper.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,13 @@ export class MatStep extends CdkStep implements ErrorStateMatcher, AfterContentI
7979
// We need an initializer here to avoid a TS error.
8080
@ContentChild(MatStepLabel) override stepLabel: MatStepLabel = undefined!;
8181

82-
/** Theme color for the particular step. */
82+
/**
83+
* Theme color for the particular step. This API is supported in M2 themes
84+
* only, it has no effect in M3 themes.
85+
*
86+
* For information on applying color variants in M3, see
87+
* https://material.angular.io/guide/theming#using-component-color-variants.
88+
*/
8389
@Input() color: ThemePalette;
8490

8591
/** Content that will be rendered lazily. */
@@ -180,7 +186,13 @@ export class MatStepper extends CdkStepper implements AfterContentInit {
180186
/** Whether ripples should be disabled for the step headers. */
181187
@Input() disableRipple: boolean;
182188

183-
/** Theme color for all of the steps in stepper. */
189+
/**
190+
* Theme color for all of the steps in stepper. This API is supported in M2
191+
* themes only, it has no effect in M3 themes.
192+
*
193+
* For information on applying color variants in M3, see
194+
* https://material.angular.io/guide/theming#using-component-color-variants.
195+
*/
184196
@Input() color: ThemePalette;
185197

186198
/**

src/material/tabs/tab-nav-bar/tab-nav-bar.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,13 @@ export class MatTabNav
135135
@Input({transform: booleanAttribute})
136136
disableRipple: boolean = false;
137137

138-
/** Theme color of the nav bar. */
138+
/**
139+
* Theme color of the nav bar. This API is supported in M2 themes only, it has
140+
* no effect in M3 themes.
141+
*
142+
* For information on applying color variants in M3, see
143+
* https://material.angular.io/guide/theming#using-component-color-variants.
144+
*/
139145
@Input() color: ThemePalette = 'primary';
140146

141147
/**

src/material/toolbar/toolbar.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,13 @@ export class MatToolbarRow {}
4646
})
4747
export class MatToolbar implements AfterViewInit {
4848
// TODO: should be typed as `ThemePalette` but internal apps pass in arbitrary strings.
49-
/** Palette color of the toolbar. */
49+
/**
50+
* Theme color of the toolbar. This API is supported in M2 themes only, it has
51+
* no effect in M3 themes.
52+
*
53+
* For information on applying color variants in M3, see
54+
* https://material.angular.io/guide/theming#using-component-color-variants.
55+
*/
5056
@Input() color?: string | null;
5157

5258
private _document: Document;

0 commit comments

Comments
 (0)