device pixel ratio

How many physical screen pixels are used for one CSS pixel, such as 2 on many high-density phone and laptop screens.

In more detail

Screenshots at different ratios have different sizes and detail, so visual tests fix it in their configuration, for example with Playwright's deviceScaleFactor option. Browsers expose it to scripts as window.devicePixelRatio.

Related terms

Taught in

References