9.0 Released! → Native ESM runtimes 🚀, Vite support ⚡️, multi-window apps and more...
Read Announcement
ts
const toDevicePixels: (length: PercentLengthType, auto: number, parentAvailableWidth: number) => number;

Defined in: ui/styling/length-shared.ts

Converts PercentLengthType unit to device pixels.

Parameters ​

ParameterTypeDescription
lengthPercentLengthTypeThe PercentLengthType to convert.
autonumberValue to use for conversion of "auto". By default is Math.NaN.
parentAvailableWidthnumberValue to use as base when converting percent unit. By default is Math.NaN.

Returns ​

number

Previous
equals
Next
parse