UNPKG

@primer/primitives

Version:

Typography, spacing, and color primitives for Primer design system

13 lines (12 loc) 657 B
import type { DimensionTokenValue } from '../../types/dimensionTokenValue.js'; /** * @description Parses and validates a dimension value in W3C DTCG object format * @param input - The dimension value in W3C object format { value: number, unit: "px" | "rem" | "em" } * @returns Validated DimensionTokenValue * @throws Error if the input is not a valid W3C dimension object * * W3C DTCG format: { value: 16, unit: "px" } * @note `em` is not in the W3C spec but is supported for practical use * @link https://www.designtokens.org/tr/drafts/format/#dimension */ export declare const parseDimension: (input: DimensionTokenValue) => DimensionTokenValue;