Skip to content

Commit

Permalink
Fix focus color contrast (#15544)
Browse files Browse the repository at this point in the history
  • Loading branch information
truchot authored and youknowriad committed May 10, 2019
1 parent 8195c74 commit 5746ac3
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
4 changes: 2 additions & 2 deletions assets/stylesheets/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@

@mixin input-style__focus() {
color: $dark-gray-900;
border-color: $blue-medium-500;
box-shadow: 0 0 0 1px $blue-medium-500;
border-color: $blue-medium-focus;
box-shadow: 0 0 0 1px $blue-medium-focus;

// Windows High Contrast mode will show this outline, but not the box-shadow.
outline: 2px solid transparent;
Expand Down
6 changes: 4 additions & 2 deletions packages/components/src/button/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@
border-color: #999;
box-shadow:
inset 0 -1px 0 #999,
0 0 0 2px $blue-medium-200;
0 0 0 1px $white,
0 0 0 3px $blue-medium-focus;
text-decoration: none;

}
Expand Down Expand Up @@ -88,7 +89,8 @@
&:focus:enabled {
box-shadow:
inset 0 -1px 0 color(theme(button) shade(50%)),
0 0 0 2px $blue-medium-200;
0 0 0 1px $white,
0 0 0 3px $blue-medium-focus;
}

&:active:enabled {
Expand Down
11 changes: 11 additions & 0 deletions packages/components/src/date-time/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@
.DayPickerNavigation_button__horizontalDefault {
padding: 2px 8px;
top: 20px;

&:focus {
border-color: $blue-medium-focus;
box-shadow: 0 0 0 1px $blue-medium-focus;
}
}

.DayPicker_weekHeader {
Expand Down Expand Up @@ -94,6 +99,12 @@
border-radius: 0 3px 3px 0;
}

.components-datetime__time-am-button:focus,
.components-datetime__time-pm-button:focus {
position: relative;
z-index: 1;
}

.components-datetime__time-am-button.is-toggled,
.components-datetime__time-pm-button.is-toggled {
background: $light-gray-300;
Expand Down

0 comments on commit 5746ac3

Please sign in to comment.