Skip to content

Commit 20af6fd

Browse files
committed
use background color for disabled items
1 parent 3cbcfd6 commit 20af6fd

File tree

3 files changed

+7
-11
lines changed

3 files changed

+7
-11
lines changed

src/lib/core/theming/_palette.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -659,6 +659,7 @@ $mat-light-theme-background: (
659659
selected-button: map_get($mat-grey, 300),
660660
selected-disabled-button: map_get($mat-grey, 400),
661661
disabled-button-toggle: map_get($mat-grey, 200),
662+
disabled-list-option: map_get($mat-grey, 200),
662663
);
663664

664665
// Background palette for dark themes.
@@ -675,6 +676,7 @@ $mat-dark-theme-background: (
675676
selected-button: map_get($mat-grey, 900),
676677
selected-disabled-button: map_get($mat-grey, 800),
677678
disabled-button-toggle: map_get($mat-grey, 1000),
679+
disabled-list-option: map_get($mat-grey, 1000),
678680
);
679681

680682
// Foreground palette for light themes.

src/lib/list/_list-theme.scss

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020
.mat-subheader {
2121
color: mat-color($foreground, secondary-text);
2222
}
23+
}
2324

24-
.mat-list-item-disabled {
25-
background: #ededed;
26-
}
25+
.mat-list-item-disabled {
26+
background-color: mat-color($background, disabled-list-option);
2727
}
2828

2929
.mat-divider {
@@ -73,10 +73,6 @@
7373
.mat-subheader {
7474
@include mat-typography-level-to-styles($config, body-2);
7575
}
76-
77-
.mat-list-item-disabled {
78-
background: #ededed;
79-
}
8076
}
8177

8278
// Dense list
@@ -94,9 +90,5 @@
9490
.mat-subheader {
9591
font: mat-font-weight($config, body-2) mat-font-size($config, caption) $font-family;
9692
}
97-
98-
.mat-list-item-disabled {
99-
background: #ededed;
100-
}
10193
}
10294
}

src/lib/list/list-option.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import {
2020
OnDestroy,
2121
EventEmitter,
2222
Output,
23+
HostBinding,
2324
ChangeDetectorRef
2425
} from '@angular/core';
2526
import {coerceBooleanProperty, MdLine, MdLineSetter} from '../core';
@@ -80,6 +81,7 @@ export class MdListOption implements AfterContentInit, OnDestroy, Focusable {
8081
@Input() checkboxPosition: 'before' | 'after' = 'after';
8182

8283
/** Whether the option is disabled. */
84+
@HostBinding('class.mat-list-item-disabled')
8385
@Input()
8486
get disabled() { return (this.selectionList && this.selectionList.disabled) || this._disabled; }
8587
set disabled(value: any) { this._disabled = coerceBooleanProperty(value); }

0 commit comments

Comments
 (0)