Skip to content

Commit 53588b5

Browse files
fix(material/stepper): add HCM disabled styles for stepper and tabs (#25393) (#25932)
* 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 Co-authored-by: Jeremy Elbourn <[email protected]>
1 parent a1473b9 commit 53588b5

File tree

2 files changed

+26
-4
lines changed

2 files changed

+26
-4
lines changed

src/material-experimental/mdc-tabs/tab-header.scss

Lines changed: 15 additions & 4 deletions
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
}

src/material/stepper/step-header.scss

Lines changed: 11 additions & 0 deletions
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

0 commit comments

Comments
 (0)