Skip to content

Commit

Permalink
fix(material/stepper): add HCM disabled styles for stepper and tabs (#…
Browse files Browse the repository at this point in the history
…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 <jelbourn@google.com>
  • Loading branch information
wagnermaciel and jelbourn committed Nov 7, 2022
1 parent a1473b9 commit 53588b5
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
19 changes: 15 additions & 4 deletions src/material-experimental/mdc-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;
}
}
}
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

0 comments on commit 53588b5

Please sign in to comment.