Skip to content

Commit

Permalink
Fix sticky hover state on iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
salomao-rodrigues committed Jun 29, 2020
1 parent f0b0578 commit 1b5450a
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 14 deletions.
13 changes: 8 additions & 5 deletions src/elements/button/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,14 @@ const invertTheme = (theme: any, variant: any = {}) => {
borderColor,
borderWidth: 2,
borderStyle: 'solid',
':hover': {
backgroundColor: hoverColor
},
':hover:not(:disabled)': {
backgroundColor: hoverColor
'@media (hover: hover)': {
// prevents sticky hover bug on iOS
':hover': {
backgroundColor: hoverColor
},
':hover:not(:disabled)': {
backgroundColor: hoverColor
}
}
}
}
Expand Down
28 changes: 19 additions & 9 deletions src/themes/journey/theme.json
Original file line number Diff line number Diff line change
Expand Up @@ -516,8 +516,10 @@
"color": "white",
"width": ["100%"],
"border": "none",
":hover": {
"backgroundColor": "grey-70"
"@media (hover: hover)": {
":hover": {
"backgroundColor": "grey-70"
}
},
":disabled": {
"backgroundColor": "grey-20",
Expand All @@ -534,8 +536,10 @@
"border": "none",
"borderColor": "uswitch-navy",
"width": ["100%"],
":hover": {
"backgroundColor": "grey-10"
"@media (hover: hover)": {
":hover": {
"backgroundColor": "grey-10"
}
},
":disabled": {
"color": "grey-40",
Expand All @@ -552,8 +556,10 @@
"backgroundColor": "uswitch-navy",
"border": "2px solid",
"borderColor": "white",
":hover": {
"backgroundColor": "grey-80"
"@media (hover: hover)": {
":hover": {
"backgroundColor": "grey-80"
}
},
":disabled": {
"borderColor": "grey-60",
Expand All @@ -576,8 +582,10 @@
"backgroundColor": "white",
"border": "2px solid",
"borderColor": "uswitch-navy",
":hover": {
"backgroundColor": "grey-100"
"@media (hover: hover)": {
":hover": {
"backgroundColor": "grey-100"
}
},
":disabled": {
"borderColor": "grey-60",
Expand Down Expand Up @@ -996,7 +1004,9 @@
"textDecoration": "underline",
"transition": "oapcity 0.2s ease",
":visited": { "color": "uswitch-navy" },
":hover": { "opacity": 0.8 }
"@media (hover: hover)": {
":hover": { "opacity": 0.8 }
}
},

"blockquote": {
Expand Down

0 comments on commit 1b5450a

Please sign in to comment.