Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@amyleadem
Copy link
Contributor

@amyleadem amyleadem commented Jun 29, 2023

Summary

Updated the ellipsis color to meet color contrast requirements.

Updated styles to respect the value added to $theme-pagination-background-color.

Breaking change

This is a potentially breaking change.
The Design System now respects the value for $theme-pagination-background-color. Users should confirm that pagination colors display as expected.

Related issue

Closes #5188

Related pull requests

Changelog PR

Preview link

Preview link: Pagination component

Problem statement

The ellipsis elements on the pagination component use opacity to lighten the color. Additionally, the color contrast is 3.31:1, which does not meet color contrast requirements.

Additionally, the background of pagination component does not respect the color added to $theme-pagination-background-color.

Solution

Update the color of the usa-pagination__overflow element to use a lighter gray color instead of opacity.

Set the background and text colors of the pagination component.

Testing and review

  • Confirm that changing the value of $theme-pagination-background-color changes the pagination background color
  • Confirm that the new ellipsis color meets requirements against various background colors
  • Confirm that the darker default ellipsis color works well in the component
  • Confirm the changelog PR looks good

- Meet color contrast requirements
@amyleadem amyleadem changed the title USWDS - Pagination: Improve color contrast on ellipsis USWDS - Pagination: Fix colors for ellipsis and background Jun 29, 2023
@amyleadem amyleadem changed the title USWDS - Pagination: Fix colors for ellipsis and background USWDS - Pagination: Fix ellipsis and background colors Jun 29, 2023
@amyleadem amyleadem marked this pull request as ready for review June 30, 2023 16:42
@amyleadem amyleadem requested review from mahoneycm and mejiaj June 30, 2023 16:42
@mejiaj mejiaj added this to the uswds 3.6.0 milestone Jul 11, 2023
Copy link
Contributor

@mejiaj mejiaj left a comment

Choose a reason for hiding this comment

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

Looks good! I can confirm:

  • Changelog entry exists.
  • No visual regressions.
  • $theme-pagination-background-color is used to set background & text color.

Notes

Some notes based on testing.

Color setting

Since the mixin passes defaults you can also get the same result by modifying $theme-body-background-color.

Warning
Some times simply changing the background (via either setting) won't lead to accessible results. In those cases you'll need to update link settings like $theme-link-color.

The fact that you can change pagination background color and not changing default link color failing is expected.

For example:

  • $theme-pagination-background-color: "green-20v" #98d035 .
  • $theme-link-color: "primary" #005ea2 (the default).
  • Results in contrast fail ― this is expected.

This note applies to all components that rely on background color for setting link colors. Not sure there's a note like that in the guidance, but wanted to document here.

How I tested

Tested different values for $theme-pagination-background-color and checked contrast in ANDI.

Colors tested

  • primary
  • primary-lighter
  • primary-darker
  • ⚠️ green-40v, see warning above in color setting.

Copy link
Contributor

@mahoneycm mahoneycm left a comment

Choose a reason for hiding this comment

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

Lookin' good!

  • $theme-pagination-background-color correctly changes pagination background color
  • Color contrast for ellipses meets requirements on various background colors
  • Darker color of ellipses still works well and looks good with the component
  • Reviewed changelog

@amyleadem amyleadem requested a review from thisisdano July 14, 2023 18:06
@amyleadem amyleadem removed this from the uswds 3.6.0 milestone Jul 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

USWDS - Bug: 508 opacity warning for ellipsis in pagination

5 participants