UX: Disable button hover effects on touch devices

This commit is contained in:
Kris 2018-10-04 17:15:37 -04:00
parent 9554d657c5
commit 98b9913033
1 changed files with 25 additions and 16 deletions

View File

@ -54,10 +54,13 @@
color: $primary; color: $primary;
min-height: unset; // ovverides button defaults min-height: unset; // ovverides button defaults
} }
&:hover, .discourse-no-touch & {
&.btn-hover { // only allow hover on no-touch devices
background: $primary-medium; &:hover,
color: $secondary; &.btn-hover {
background: $primary-medium;
color: $secondary;
}
} }
&[disabled], &[disabled],
&.disabled { &.disabled {
@ -89,12 +92,15 @@
&[href] { &[href] {
color: $secondary; color: $secondary;
} }
&:hover, .discourse-no-touch & {
&.btn-hover { // only allow hover on no-touch devices
background: dark-light-choose( &:hover,
scale-color($tertiary, $lightness: -20%), &.btn-hover {
scale-color($tertiary, $lightness: 20%) background: dark-light-choose(
); scale-color($tertiary, $lightness: -20%),
scale-color($tertiary, $lightness: 20%)
);
}
} }
&:active, &:active,
&.btn-active { &.btn-active {
@ -119,12 +125,15 @@
&[href] { &[href] {
color: $secondary; color: $secondary;
} }
&:hover, .discourse-no-touch & {
&.btn-hover { // only allow hover on no-touch devices
background: dark-light-choose( &:hover,
scale-color($danger, $lightness: -20%), &.btn-hover {
scale-color($danger, $lightness: 20%) background: dark-light-choose(
); scale-color($danger, $lightness: -20%),
scale-color($danger, $lightness: 20%)
);
}
} }
&:active, &:active,
&.btn-active { &.btn-active {