Skip to content

Calendar style a11y updates #7473

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
Jan 22, 2025
Merged

Conversation

jcfilben
Copy link
Collaborator

@jcfilben jcfilben commented Jan 21, 2025

What does this PR do?

Updates the Calendar styling to meet accessibility requirements. Based on work done in #7423.

The calendar.day.adjacent.color theme prop was added because in the HPE theme we want the calendar dates outside of the month to be text-weak instead of text-xweak.
Open to naming suggestions on the theme prop. I went with the adjacent naming because this aligns with the showAdjacentDays prop on the Calendar component which controls if days outside of the month should be displayed or not.

Where should the reviewer start?

What testing has been done on this PR?

How should this be manually tested?

Do Jest tests follow these best practices?

  • screen is used for querying.
  • The correct query is used. (Refer to this list of queries)
  • asFragment() is used for snapshot testing.

Any background context you want to provide?

What are the relevant issues?

#7467

Screenshots (if appropriate)

Do the grommet docs need to be updated?

yes

Should this PR be mentioned in the release notes?

yes

Is this change backwards compatible or is it a breaking change?

backwards compatible because previously we weren't meeting WCAG AA contrast requirements

@jcfilben jcfilben requested a review from britt6612 January 21, 2025 20:56
@@ -708,7 +708,7 @@ const Calendar = forwardRef(
sizeProp={size}
fillContainer={fill}
>
<StyledDay otherMonth sizeProp={size} fillContainer={fill}>
Copy link
Collaborator

Choose a reason for hiding this comment

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

why was this taken out?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Previously the days of the week were receiving the otherMonth styling, but we don't want this to happen anymore and instead they should get the same styling as the regular days of the month.

Copy link
Collaborator

Choose a reason for hiding this comment

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

okay thank you for clarifying

color: ${(props) =>
normalizeColor(
props.otherMonth
? props.theme.calendar?.day?.adjacent?.color || 'text-xweak'
Copy link
Collaborator

Choose a reason for hiding this comment

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

think this naming makes sense

@britt6612 britt6612 requested a review from MikeKingdom January 21, 2025 21:47
Copy link
Collaborator

@MikeKingdom MikeKingdom left a comment

Choose a reason for hiding this comment

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

LGTM

@jcfilben jcfilben merged commit 5bdde99 into grommet:master Jan 22, 2025
12 of 14 checks passed
@jcfilben jcfilben deleted the calendar-color-a11y branch January 22, 2025 23:16
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.

3 participants