]> git.cworth.org Git - lmno.games/commitdiff
Restrict :hover styling to when a media query says hover is fully supported
authorCarl Worth <cworth@cworth.org>
Mon, 8 Jun 2020 16:13:43 +0000 (09:13 -0700)
committerCarl Worth <cworth@cworth.org>
Mon, 8 Jun 2020 16:13:43 +0000 (09:13 -0700)
Otherwise, on my phone I was seeing "sticky" hover effects, (after I
clicked a button it stayed looking like it was still being pressed
after I let go which was very confusing).

style.css

index 240014ad57e7190549f40f315b020c8107e4379c..b4d5b1b7445d6c9cb8aee3f27f232637b6dd5dc0 100644 (file)
--- a/style.css
+++ b/style.css
@@ -82,8 +82,10 @@ a:link    {
 a:visited {
     color: var(--accent-color);
 }
 a:visited {
     color: var(--accent-color);
 }
-a:hover   {
-    color: var(--accent-color-bright);
+@media (hover:hover) {
+    a:hover   {
+        color: var(--accent-color-bright);
+    }
 }
 a:active  {
     color: var(--accent-color-bright);
 }
 a:active  {
     color: var(--accent-color-bright);
@@ -279,9 +281,11 @@ button.inline {
     width: auto;
 }
 
     width: auto;
 }
 
-button:hover {
-    transform: translateY(-1px);
-    background-color: var(--accent-color-bright);
+@media (hover:hover) {
+    button:hover {
+        transform: translateY(-1px);
+        background-color: var(--accent-color-bright);
+    }
 }
 
 :focus {
 }
 
 :focus {
@@ -332,8 +336,10 @@ button:hover {
     top: 0;
 }
 
     top: 0;
 }
 
-.hide-button:hover {
-    color: var(--danger-color-dark);
+@media (hover:hover) {
+    .hide-button:hover {
+        color: var(--danger-color-dark);
+    }
 }
 
 /*\
 }
 
 /*\