File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
tools/public_api_guard/material Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -69,6 +69,9 @@ export interface MatTabGroupBaseHeader {
69
69
/** Possible positions for the tab header. */
70
70
export type MatTabHeaderPosition = 'above' | 'below' ;
71
71
72
+ /** Boolean constant that determines whether the tab group supports the `backgroundColor` input */
73
+ const ENABLE_BACKGROUND_INPUT = true ;
74
+
72
75
/**
73
76
* Material design tab-group component. Supports basic tab pairs (label + content) and includes
74
77
* animated ink-bar, keyboard navigation, and screen reader.
@@ -236,13 +239,21 @@ export class MatTabGroup
236
239
237
240
private _preserveContent : boolean = false ;
238
241
239
- /** Background color of the tab group. */
242
+ /**
243
+ * Background color of the tab group.
244
+ * @deprecated The background color should be customized through Sass theming APIs.
245
+ * @breaking -change 20.0.0 Remove this input
246
+ */
240
247
@Input ( )
241
248
get backgroundColor ( ) : ThemePalette {
242
249
return this . _backgroundColor ;
243
250
}
244
251
245
252
set backgroundColor ( value : ThemePalette ) {
253
+ if ( ! ENABLE_BACKGROUND_INPUT ) {
254
+ throw new Error ( `mat-tab-group background color must be set through the Sass theming API` ) ;
255
+ }
256
+
246
257
const classList : DOMTokenList = this . _elementRef . nativeElement . classList ;
247
258
248
259
classList . remove ( 'mat-tabs-with-background' , `mat-background-${ this . backgroundColor } ` ) ;
Original file line number Diff line number Diff line change @@ -266,6 +266,7 @@ export class MatTabGroup extends _MatTabGroupMixinBase implements AfterContentIn
266
266
set animationDuration(value : NumberInput );
267
267
// (undocumented)
268
268
_animationMode? : string | undefined ;
269
+ // @deprecated
269
270
get backgroundColor(): ThemePalette ;
270
271
set backgroundColor(value : ThemePalette );
271
272
get contentTabIndex(): number | null ;
You can’t perform that action at this time.
0 commit comments