has-hover class to the body if the user can hover with their device (i.e. not a touch device), which allows you to write conditional CSS to only apply hover pseudo selectors if the
has-hover class exists, preventing the double click issue on touch devices. Also exposes a
You can install via npm or yarn.
npm install --save browser-has-hover
yarn add browser-has-hover
You can import using ES6 imports. You can just import the library if you only want it to add the
has-hover class to the body.
;if hasHover// Do stuff for if the browser has hover