Skip to content

Commit

Permalink
Add HCM disabled styles for stepper and tabs (#25393)
Browse files Browse the repository at this point in the history
* 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

(cherry picked from commit bdec140)
  • Loading branch information
jelbourn authored and wagnermaciel committed Nov 6, 2022
1 parent 30a4e75 commit 20a2ba9
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
11 changes: 11 additions & 0 deletions src/material/stepper/step-header.scss
Expand Up @@ -25,6 +25,17 @@
text-decoration: underline;
}
}

// When a step header is disabled in high contrast mode, set the text color to the disabled
// color, which is (unintuitively) named "GrayText".
&[aria-disabled='true'] {
outline-color: GrayText;
.mat-step-label,
.mat-step-icon,
.mat-step-optional {
color: GrayText;
}
}
}
}

Expand Down
19 changes: 15 additions & 4 deletions src/material/tabs/tab-header.scss
@@ -1,3 +1,4 @@
@use '@angular/cdk';
@use './tabs-common';

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

// For the tab element, default inset/offset values are necessary to ensure that
// the focus indicator is sufficiently contrastive and renders appropriately.
.mat-mdc-tab::before {
margin: 5px;
.mat-mdc-tab {
// For the tab element, default inset/offset values are necessary to ensure that
// the focus indicator is sufficiently contrastive and renders appropriately.
&::before {
margin: 5px;
}

@include cdk.high-contrast(active, off) {
// When a tab is disabled in high contrast mode, set the text color to the disabled
// color, which is (unintuitively) named "GrayText".
&[aria-disabled='true'] {
color: GrayText;
}
}
}

0 comments on commit 20a2ba9

Please sign in to comment.