@@ -52,6 +52,9 @@ export interface MatTabGroupBaseHeader {
52
52
/** Possible positions for the tab header. */
53
53
export type MatTabHeaderPosition = 'above' | 'below' ;
54
54
55
+ /** Boolean constant that determines whether the tab group supports the `backgroundColor` input */
56
+ const ENABLE_BACKGROUND_INPUT = true ;
57
+
55
58
/**
56
59
* Material design tab-group component. Supports basic tab pairs (label + content) and includes
57
60
* animated ink-bar, keyboard navigation, and screen reader.
@@ -201,22 +204,28 @@ export class MatTabGroup implements AfterContentInit, AfterContentChecked, OnDes
201
204
@Input ( { transform : booleanAttribute } )
202
205
preserveContent : boolean = false ;
203
206
204
- /** Background color of the tab group. */
207
+ /**
208
+ * Background color of the tab group.
209
+ * @deprecated The background color should be customized through Sass theming APIs.
210
+ * @breaking -change 20.0.0 Remove this input
211
+ */
205
212
@Input ( )
206
213
get backgroundColor ( ) : ThemePalette {
207
214
return this . _backgroundColor ;
208
215
}
209
216
210
217
set backgroundColor ( value : ThemePalette ) {
211
- const classList : DOMTokenList = this . _elementRef . nativeElement . classList ;
218
+ if ( ENABLE_BACKGROUND_INPUT ) {
219
+ const classList : DOMTokenList = this . _elementRef . nativeElement . classList ;
212
220
213
- classList . remove ( 'mat-tabs-with-background' , `mat-background-${ this . backgroundColor } ` ) ;
221
+ classList . remove ( 'mat-tabs-with-background' , `mat-background-${ this . backgroundColor } ` ) ;
214
222
215
- if ( value ) {
216
- classList . add ( 'mat-tabs-with-background' , `mat-background-${ value } ` ) ;
217
- }
223
+ if ( value ) {
224
+ classList . add ( 'mat-tabs-with-background' , `mat-background-${ value } ` ) ;
225
+ }
218
226
219
- this . _backgroundColor = value ;
227
+ this . _backgroundColor = value ;
228
+ }
220
229
}
221
230
222
231
private _backgroundColor : ThemePalette ;
0 commit comments