Last active
March 13, 2020 07:47
-
-
Save taimursaeed/277cf0410e24c1062f89dafec7108a53 to your computer and use it in GitHub Desktop.
Target Touch Screens Via CSS Queries
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@media (pointer: none), (pointer: coarse) { | |
} | |
//via https://stackoverflow.com/a/50302305/4882234 | |
/* smartphones, touchscreens */ | |
@media (hover: none) and (pointer: coarse) { | |
/* ... */ | |
} | |
/* stylus-based screens */ | |
@media (hover: none) and (pointer: fine) { | |
/* ... */ | |
} | |
/* Nintendo Wii controller, Microsoft Kinect */ | |
@media (hover: hover) and (pointer: coarse) { | |
/* ... */ | |
} | |
/* mouse, touch pad */ | |
@media (hover: hover) and (pointer: fine) { | |
/* ... */ | |
} | |
// Via: https://medium.com/@ferie/detect-a-touch-device-with-only-css-9f8e30fa1134 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment