Skip to main content

Screen

The screen component checks whether your screen is a touch screen, and how many touch points it supports. It also checks the resolution, if it deems the device to be a mobile device. For non-mobile devices, the screen resolution is not used, as it would return a different value on multi-screen setups if the window was moved to a different screen.

The screen component also checks for other screen settings through media queries, like contrast preferences and inverted colors etc.

Example

"screen": {
"is_touchscreen": false,
"maxTouchPoints": 0,
"colorDepth": 24,
"mediaMatches": [
"prefers-contrast: no-preference",
"any-hover: hover",
"any-pointer: fine",
"pointer: fine",
"hover: hover",
"update: fast",
"prefers-reduced-motion: no-preference",
"prefers-reduced-transparency: no-preference",
"scripting: enabled",
"forced-colors: none"
]
},

Code

Check out the implementation