Skip to content

Add HCM disabled styles for stepper and tabs #25393

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/material/stepper/step-header.scss
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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;
}
}
}