Skip to content

[css-env] Device Pixel Ratio #5986

@Crissov

Description

@Crissov

As a result of #614, please add environment variables:

  • env(device-pixel-ratio)
  • env(device-pixel-ratio-x)
  • env(device-pixel-ratio-y)

This is a <number> constant, which can be used verbatim as a multiplier or divisor with a <length>, e.g. calc(1mm * env(device-pixel-ratio, 1)), to get from nominal, CSS millimeters to actual, SI millimeters etc.

On media and devices where px depends on physical units and not the other way around (as on screens), this should always be set to 1.0. Elsewhere, it should not deviate a lot from this.

I included horizontal and vertical variants, because not all pixels are square.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions