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) 826 B
import type { CSSColorValue, ColorValue } from '../types'; /** * Parses a CSS color value into structured components * @param value - The CSS color value string * @returns Parsed color object, or null if invalid */ export declare function parse(value: string): ColorValue | null; /** * Converts a parsed color back to a CSS value string * @param parsed - The parsed color object * @returns CSS value string or null if invalid */ export declare function toCSSValue(parsed: ColorValue | null): string | null; export declare function parseHexColor(value: string): CSSColorValue | null; export declare function parseRgbColor(value: string): CSSColorValue | null; export declare function parseHslColor(value: string): CSSColorValue | null; export declare function reconstructHexColor(parsed: CSSColorValue): string | null;