Files
outline/app/utils/browser.ts
Tom Moor 175857753e fix: Bag 'o fixes
Remove menu hover styles on mobile
Fixed duplicate hover+active behavior on editor menus
Fixed editor menus visibly scroll to the top when reopened
Fixed some minor editor spacing issues
Renamed shred routeHelpers -> urlHelpers
2022-01-25 23:43:11 -08:00

18 lines
442 B
TypeScript

/**
* Returns true if the client is a touch device.
*/
export function isTouchDevice(): boolean {
if (typeof window === "undefined") {
return false;
}
return window.matchMedia?.("(hover: none) and (pointer: coarse)")?.matches;
}
/**
* Returns true if the client is running on a Mac.
*/
export function isMac(): boolean {
const SSR = typeof window === "undefined";
return !SSR && window.navigator.platform === "MacIntel";
}