CssValues
CSS value parsers: lengths to points, and colours to RgbColor. Shared by the EPUB cascade and the SVG renderer, which read the same syntax.
They take the raw token text and no context, so each caller interprets a value against the right reference (font size, root size, containing width).
Length model: 1 CSS px = 1/96 in, 1 pt = 1/72 in, so px → pt is ×0.75. em is relative to the caller's fontSizePt (the parent's size when resolving font-size itself, else the element's own), rem to rootPt, % to refPt (parent size for font-size, containing width for margins, etc.).
Functions
Parse a CSS <length>/<percentage> to points, or null if not a length. vw and vh resolve against refPt here; length with a viewport resolves them as CSS asks.
length, with the viewport units against a viewport of viewportWidthPt by viewportHeightPt, whatever the property: 1vw is 1% of its width, 1vh 1% of its height, and vmin and vmax the smaller and larger of the two (CSS Values and Units 4, 6.1.2; #849).