Skip to content

Commit

Permalink
fix(core-button): no hover on touch screens
Browse files Browse the repository at this point in the history
  • Loading branch information
cianfoley-nearform authored and jraff committed Mar 22, 2021
1 parent fa71cd1 commit be8cb85
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/Button/Button.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,13 @@ const getVariant = ({ variant, rank }) => {
border,
transition,
'&:hover': hover,
'@media (hover: none)': {
'&:hover': {
boxShadow: 'none',
backgroundColor,
color,
},
},
'&:active': active,
'&:focus': focus,
'@media (prefers-reduced-motion: reduce)': {
Expand Down
24 changes: 24 additions & 0 deletions packages/Button/__tests__/__snapshots__/Button.spec.jsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,14 @@ exports[`Button can be presented as one of the allowed variants 1`] = `
}
}
@media (hover:none) {
.c0:hover {
box-shadow: none;
background-color: #4b286d;
color: #fff;
}
}
@media (prefers-reduced-motion:reduce) {
.c0 {
-webkit-transition: none !important;
Expand Down Expand Up @@ -164,6 +172,14 @@ exports[`Button can be presented as one of the new allowed variants 1`] = `
}
}
@media (hover:none) {
.c0:hover {
box-shadow: none;
background-color: #fff;
color: #2B8000;
}
}
@media (prefers-reduced-motion:reduce) {
.c0 {
-webkit-transition: none !important;
Expand Down Expand Up @@ -249,6 +265,14 @@ exports[`Button renders 1`] = `
}
}
@media (hover:none) {
.c0:hover {
box-shadow: none;
background-color: #2B8000;
color: #fff;
}
}
@media (prefers-reduced-motion:reduce) {
.c0 {
-webkit-transition: none !important;
Expand Down

0 comments on commit be8cb85

Please sign in to comment.