Help prepare for 2025 → Answer 8 simple questions on our Fall Survey
Open Survey

Summary

Functions

convertToString

convertToString(length: PercentLengthType): string
Parameter Default Description
length

Returns string

equals

equals(a: PercentLengthType, b: PercentLengthType): boolean
Parameter Default Description
a

b

Returns boolean

parse

parse(text: string): PercentLengthType
Parameter Default Description
text
string

toDevicePixels

toDevicePixels(length: PercentLengthType, auto?: number, parentAvailableWidth?: number): number
Converts PercentLengthType unit to device pixels.
Parameter Default Description
length

The PercentLengthType to convert.

auto
number

Value to use for conversion of "auto". By default is Math.NaN.

parentAvailableWidth
number

Value to use as base when converting percent unit. By default is Math.NaN.

Returns number
Previous
Length