Skip to content

Commit bdec140

Browse files
authored
Add HCM disabled styles for stepper and tabs (#25393)
* fix(material/stepper): add HCM disabled styles This adds disabled styles for stepper header in high contrast mode * fix(material/tabs): add HCM disabled styles This adds disabled styles for tab labels in high contrast mode
1 parent eadb6b1 commit bdec140

File tree

2 files changed

+26
-4
lines changed

2 files changed

+26
-4
lines changed

src/material/stepper/step-header.scss

+11
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,17 @@
2525
text-decoration: underline;
2626
}
2727
}
28+
29+
// When a step header is disabled in high contrast mode, set the text color to the disabled
30+
// color, which is (unintuitively) named "GrayText".
31+
&[aria-disabled='true'] {
32+
outline-color: GrayText;
33+
.mat-step-label,
34+
.mat-step-icon,
35+
.mat-step-optional {
36+
color: GrayText;
37+
}
38+
}
2839
}
2940
}
3041

src/material/tabs/tab-header.scss

+15-4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
@use '@angular/cdk';
12
@use './tabs-common';
23

34
@include tabs-common.paginated-tab-header;
@@ -10,8 +11,18 @@
1011
@include tabs-common.paginated-tab-header-item-wrapper('.mat-mdc-tab-header');
1112
}
1213

13-
// For the tab element, default inset/offset values are necessary to ensure that
14-
// the focus indicator is sufficiently contrastive and renders appropriately.
15-
.mat-mdc-tab::before {
16-
margin: 5px;
14+
.mat-mdc-tab {
15+
// For the tab element, default inset/offset values are necessary to ensure that
16+
// the focus indicator is sufficiently contrastive and renders appropriately.
17+
&::before {
18+
margin: 5px;
19+
}
20+
21+
@include cdk.high-contrast(active, off) {
22+
// When a tab is disabled in high contrast mode, set the text color to the disabled
23+
// color, which is (unintuitively) named "GrayText".
24+
&[aria-disabled='true'] {
25+
color: GrayText;
26+
}
27+
}
1728
}

0 commit comments

Comments
 (0)