Skip to content

fix(material/stepper): add styling to stepper for high contrast mode #23526

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
Sep 27, 2021

Conversation

amysorto
Copy link
Contributor

@amysorto amysorto commented Sep 3, 2021

No description provided.

@amysorto amysorto requested a review from mmalerba as a code owner September 3, 2021 22:25
@google-cla google-cla bot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Sep 3, 2021
@amysorto amysorto added Accessibility This issue is related to accessibility (a11y) target: patch This PR is targeted for the next patch release labels Sep 3, 2021
@@ -15,6 +16,25 @@
$warn: map.get($config, warn);

.mat-step-header {
@include a11y.high-contrast(active, off) {
margin-bottom: 1px;
margin-top: 1px;
Copy link
Member

Choose a reason for hiding this comment

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

Why do we need this margin? In general I've been trying to avoid changing any layout properties for high contrast mode.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I was pretty hesistant about this, but removing it causes slight weird overlapping (like the overhead text when typing into the input) over some of the outlines. I am not sure how big of an issue that is but I ended up removing it.

margin-top: 1px;

&:not([aria-disabled]),
&[aria-disabled='false'] {
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't we have the outline around all steps, even if they're disabled?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought about that, but I removed the outline since now if you hover over the disabled button there is no styling so it feels similar here.

Although since I changed the selected step to have an underline, it looks very strange without an outline so now all buttons have outlines.

}

&[aria-selected='false'] {
.mat-step-icon, .mat-step-label {
Copy link
Member

@crisbeto crisbeto Sep 4, 2021

Choose a reason for hiding this comment

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

Wouldn't this make the icons harder to see? We could potentially use text-decoration: underline to distinguish the selected step.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah the icons are harder to see, although adding the text-decoration: undeline looks good to me so I changed it.

@@ -15,6 +16,25 @@
$warn: map.get($config, warn);

.mat-step-header {
Copy link
Member

Choose a reason for hiding this comment

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

The HC styles should be in the _stepper.scss, not in the theme.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can't find that file

Copy link
Member

Choose a reason for hiding this comment

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

.mat-stepper-vertical-line::before {
border-left-color: theming.get-color-from-palette($foreground, divider);
@include a11y.high-contrast(active, off) {
Copy link
Member

Choose a reason for hiding this comment

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

Why do we need to remove this border?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed it at first because I thought there was too many lines with the outlines over the buttons in the step header. Although looking at it again it looks fine so I added it back in.

@jelbourn
Copy link
Member

jelbourn commented Sep 7, 2021

+1 to all of Kristiyan's comments

@amysorto amysorto force-pushed the high-contrast-fixes-for-stepper branch from 4516ff1 to 9e37957 Compare September 7, 2021 22:18
@jelbourn
Copy link
Member

jelbourn commented Sep 8, 2021

@amysorto can you also post a screenshot of the HC appearance?

@amysorto
Copy link
Contributor Author

amysorto commented Sep 8, 2021

Here are the screenshots in high contrast mode:

Horizontal Stepper
hc-horizontal-stepper

Vertical Stepper
hc-vertical-stepper

@jelbourn
Copy link
Member

@amysorto looks like the only change left to make is moving the styles to stepper.scss

@amysorto amysorto force-pushed the high-contrast-fixes-for-stepper branch from 9e37957 to 6120cfd Compare September 21, 2021 21:31
Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

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

LGTM

@jelbourn jelbourn added the action: merge The PR is ready for merge by the caretaker label Sep 23, 2021
@amysorto amysorto merged commit 980f6b2 into angular:master Sep 27, 2021
amysorto added a commit that referenced this pull request Sep 27, 2021
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Oct 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Accessibility This issue is related to accessibility (a11y) action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants