Skip to content
This repository was archived by the owner on Dec 18, 2024. It is now read-only.

fix(material/api-theme): fix nav items hover/focus contrast #1004

Merged
merged 3 commits into from
Jun 15, 2021

Conversation

kian23kpt
Copy link
Contributor

Fix hover and focus indicators on header nav items with sufficient contrast

Fixes #759

Fix hover and focus indicators on header nav items with sufficient contrast

Fixes angular#759
@google-cla google-cla bot added the cla: yes label Jun 2, 2021
@kian23kpt
Copy link
Contributor Author

kian23kpt commented Jun 2, 2021

Screenshot (15)
Screenshot (18)

@Splaktar

Copy link
Contributor

@Splaktar Splaktar left a comment

Choose a reason for hiding this comment

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

Thank you for the screenshots, but what is hovered in those? It looks like it's just showing the selected?

What does it look like when an item has focus?

Ideally, hover and focus will be a slightly different shade than selected.

@kian23kpt
Copy link
Contributor Author

Thank you for the screenshots, but what is hovered in those? It looks like it's just showing the selected?

What does it look like when an item has focus?

Ideally, hover and focus will be a slightly different shade than selected.

Screenshot from 2021-06-13 11-17-19
Screenshot from 2021-06-13 11-17-44
Screenshot from 2021-06-13 11-18-12
Screenshot from 2021-06-13 11-18-54

Guides hovered in screenshots & Components selected.

@kian23kpt kian23kpt requested a review from Splaktar June 13, 2021 06:59
@Splaktar
Copy link
Contributor

@kian23kpt you verified that the contrast in the hovered text is sufficient?

Copy link
Contributor

@Splaktar Splaktar left a comment

Choose a reason for hiding this comment

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

LGTM


& a:hover, & a:focus {
background: rgba(0, 0, 0, 0.4);
color: mat.get-color-from-palette($accent, 200);
Copy link
Contributor

Choose a reason for hiding this comment

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

I just want to make sure that 200 here isn't too dark to meet the contrast guidelines.

Copy link
Contributor

Choose a reason for hiding this comment

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

What was the purpose of using the accent color here instead of just inheriting the color? Was the shade of the background not enough to differentiate selected versus hovered/focus states? or was there a contrast issue?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What was the purpose of using the accent color here instead of just inheriting the color? Was the shade of the background not enough to differentiate selected versus hovered/focus states? or was there a contrast issue?

Used only to differentiate, similar to the sidebar. but by removing it, there is no problem of contrast.

@Splaktar Splaktar self-assigned this Jun 14, 2021
@kian23kpt
Copy link
Contributor Author

@kian23kpt you verified that the contrast in the hovered text is sufficient?

Yes, checked!

@Splaktar Splaktar merged commit e049f8b into angular:master Jun 15, 2021
jelbourn added a commit to jelbourn/material.angular.io that referenced this pull request Nov 3, 2021
Updates to the latest RC versions for v13. This also reverts a change
from angular#1004 which made the hover color for the top nav buttons use the
accent color, which is **wildly** off-spec.
jelbourn added a commit that referenced this pull request Nov 3, 2021
Updates to the latest RC versions for v13. This also reverts a change
from #1004 which made the hover color for the top nav buttons use the
accent color, which is **wildly** off-spec.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hover and focus indicators on header nav items have insufficient contrast
2 participants