UNPKG

@wix/css-property-parser

Version:

A comprehensive TypeScript library for parsing and serializing CSS property values with full MDN specification compliance

18 lines (17 loc) 820 B
import { CSSLengthPercentageValue, MarginKeyword, CSSVariableValue } from '../types'; export type MarginValue = CSSLengthPercentageValue | MarginKeyword | CSSVariableValue; /** * Shared parser for all individual margin properties * All margin properties (margin-top, margin-right, margin-bottom, margin-left) * have identical syntax: <length-percentage> | auto | global-keywords * * @param value - The CSS margin property string * @returns Parsed margin value or null if invalid */ export declare function parseMarginProperty(value: string): MarginValue | null; /** * Shared toCSSValue function for all individual margin properties * @param parsed - The parsed margin value * @returns CSS value string or null if invalid */ export declare function marginToCSSValue(parsed: MarginValue | null): string | null;