Skip to content

fix(material/datepicker): adjust focused date background for better visibility - #21176

Merged
mmalerba merged 1 commit into
angular:masterfrom
annieyw:datepicker-contrast
Dec 17, 2020
Merged

fix(material/datepicker): adjust focused date background for better visibility#21176
mmalerba merged 1 commit into
angular:masterfrom
annieyw:datepicker-contrast

Conversation

@annieyw

@annieyw annieyw commented Nov 30, 2020

Copy link
Copy Markdown
Contributor

Fixes: #18845

Before:
A6ZjRCNQQNuinkY

After:
8Pobz56tMEDUwft
8xAbQdUmWJyCZFv

@annieyw
annieyw requested a review from jelbourn November 30, 2020 19:36
@annieyw
annieyw requested a review from mmalerba as a code owner November 30, 2020 19:36
@google-cla google-cla Bot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Nov 30, 2020
@annieyw annieyw added Accessibility This issue is related to accessibility (a11y) P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent target: patch This PR is targeted for the next patch release labels Nov 30, 2020
@jelbourn

jelbourn commented Dec 1, 2020

Copy link
Copy Markdown
Contributor

What are the contrast ratios on the text with the new treatment?

@annieyw

annieyw commented Dec 1, 2020

Copy link
Copy Markdown
Contributor Author

5 for dark mode and 11.73 for light mode

@mmalerba

mmalerba commented Dec 1, 2020

Copy link
Copy Markdown
Contributor

What about just using a darker gray? In my mind the color is kind of associated with being selected. I'm also curious what this would look like on a date-range picker, where I think dates in between the 2 selected end points are a similar color to what you used here

@annieyw

annieyw commented Dec 1, 2020

Copy link
Copy Markdown
Contributor Author

This is what it looks like with the range, I think it still looks fine, what do you think?
6mZ7NzpcseP46vT
I chose to use a color background because https://material.io/components/date-pickers#anatomy (Desktop date picker
section)

@mmalerba

mmalerba commented Dec 1, 2020

Copy link
Copy Markdown
Contributor

Ah I scanned the spec but didn't notice that. In that case yeah, lets go with the color

@mmalerba

mmalerba commented Dec 1, 2020

Copy link
Copy Markdown
Contributor

For reference, here's what it looks like when overlapping the green and yellow:
image

It's not my favorite, but good enough

@mmalerba mmalerba left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@crisbeto

crisbeto commented Dec 1, 2020

Copy link
Copy Markdown
Member

Looking through the designs in the spec (https://material.io/components/date-pickers#desktop-pickers), it seems like the circle is supposed to be transparent with an outline when selecting a range. It may end up complicating the selectors though.

4MQlRn9

A bit further down there's a graphic that says not to use the same colors for selected and hover.

Date_pickers_-Material_Design-_Google_Chrome_2020-12-01_21-11-58

@annieyw

annieyw commented Dec 1, 2020

Copy link
Copy Markdown
Contributor Author

For the part where it says not to use the same style for hover and selected states I think it refers to selected range vs to be selected range. However it does seem like the datepicker and date range picker have slightly different hover state treatments.

@annieyw

annieyw commented Dec 2, 2020

Copy link
Copy Markdown
Contributor Author

Confirmed with MDC designer that hover over selected range should be same as normal datepicker
unnamed

@annieyw annieyw added the action: merge The PR is ready for merge by the caretaker label Dec 2, 2020

@jelbourn jelbourn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@mmalerba
mmalerba merged commit dfe3236 into angular:master Dec 17, 2020
mmalerba pushed a commit that referenced this pull request Dec 17, 2020
@annieyw
annieyw deleted the datepicker-contrast branch January 6, 2021 11:48
wagnermaciel pushed a commit to wagnermaciel/components that referenced this pull request Jan 14, 2021
@angular-automatic-lock-bot

Copy link
Copy Markdown

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 Feb 6, 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 P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Date Picker - Contrast ratio low for focused date cells

4 participants