Skip to content

@serenity-is/sleekgrid / parsePx

Function: parsePx()

parsePx(str): number

Defined in: src/core/util.tsx:185

Parses a CSS pixel string (e.g. "20px") into a number, returning 0 for non-numeric input.

Parameters

str

string

CSS length string to parse.

Returns

number

Numeric pixel value or 0 when parsing fails.