-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Fix/calendar focus #21600
Fix/calendar focus #21600
Conversation
.CalendarDay { | ||
font-size: $default-font-size; | ||
border: 1px solid transparent; | ||
border: none; |
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.
By setting this to none, no border should show up on regular days in Windows 10 high contrast mode.
border-radius: $radius-round; | ||
text-align: center; | ||
|
||
&:focus { | ||
box-shadow: inset 0 0 0 $border-width-focus theme(primary), inset 0 0 0 #{ $border-width-focus + $border-width } $white; |
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.
The focus style is drawn using box shadows to create a circle. There's an inset white lower layer shadow to make it visible even on a selected day.
Windows 10 high contrast mode gets a transparent outline instead, which it makes opaque, and it strips away the box shadow.
} | ||
|
||
.CalendarDay__selected { | ||
background: theme(primary); | ||
border: 2px solid transparent; // This indicates selection in Windows 10 high contrast mode. |
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.
Size Change: +237 B (0%) Total Size: 840 kB
ℹ️ View Unchanged
|
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.
Thanks @jasmussen, this is working really well!
Fixes #15929.
Alternative to #15962.
This PR adds a better focus style to calendar days, and ensures that it works in Windows 10 high contrast mode: