-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Conversation
@@ -708,7 +708,7 @@ const Calendar = forwardRef( | |||
sizeProp={size} | |||
fillContainer={fill} | |||
> | |||
<StyledDay otherMonth sizeProp={size} fillContainer={fill}> |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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' |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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 betext-weak
instead oftext-xweak
.Open to naming suggestions on the theme prop. I went with the
adjacent
naming because this aligns with theshowAdjacentDays
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.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