Skip to content

fix(material-experimental/chips): high contrast mode fixes #16811

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 1 commit into from
Aug 21, 2019
Merged
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
18 changes: 16 additions & 2 deletions src/material-experimental/mdc-chips/chips.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@import '@material/chips/mixins';
@import '../../material/core/style/noop-animation';
@import '../../cdk/a11y/a11y';
@import '../mdc-helpers/mdc-helpers';

@include mdc-chip-without-ripple($query: $mat-base-styles-query);
Expand All @@ -13,6 +14,15 @@
overflow: hidden;
// Required for the ripple to clip properly in Safari.
transform: translateZ(0);

@include cdk-high-contrast {
outline: solid 1px;

&:focus {
// Use 2px here since the dotted outline is a little thinner.
outline: dotted 2px;
}
}
}

// The MDC chip styles related to hover and focus states are intertwined with the MDC ripple styles.
Expand All @@ -25,9 +35,13 @@
position: absolute;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.2);

// Note that we use a `background` and `opacity`, instead of an `rgba` background, because
// `rgba` backgrounds get converted into solid colors in high contrast mode.
background: #000;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just black?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I went with this since it's shorter.

opacity: 0.2;
top: 0;
left:0;
left: 0;
pointer-events: none;
}
}
Expand Down