Usually, when detecting mobile or tablet devices against a desktop, I use the following media queries.
@media only screen and (min-width: 991px)
I have a table component that renders the action buttons in each row on hover using the visibility setting in CSS. However, when the device is lower than min-width 991px, the icons are visible all the time as a mobile device don't use hover.
Now the issue is that iPads in landscape and iPad pros are more significant than the width 991. Is there a more advanced media query or Javascript code I can use to detect if its a mobile/iPad device vs a desktop browser.
I am using React and have created custom hooks for inline media queries for applying dynamic styles but that has the same issue.
Thank you Jonas for adding some advice about media queries with screen sizes however this does not cover my question. I am using media queries to turn off hover mode and some large tablets fall under laptop screen sizes. There is a great answer provided below.