@wix/css-property-parser
Version:
A comprehensive TypeScript library for parsing and serializing CSS property values with full MDN specification compliance
24 lines (23 loc) • 823 B
TypeScript
import type { ZIndexValue } from '../types';
type ZIndexValueUnion = ZIndexValue;
/**
* Parses a CSS z-index property value according to MDN specification
*
* Supports:
* - auto: Stack level equals parent element (default)
* - Integer values: Positive, zero, or negative integers
* - Global keywords: inherit, initial, unset, revert, revert-layer
* - CSS variables: var(--custom-z-index)
*
* @param value - The CSS value to parse
* @returns Parsed ZIndexValue or null if invalid
*/
export declare function parse(value: string): ZIndexValueUnion | null;
/**
* Converts a parsed ZIndexValue back to CSS string representation
*
* @param parsed - The parsed z-index value
* @returns CSS string or null if invalid
*/
export declare function toCSSValue(parsed: ZIndexValueUnion | null): string | null;
export {};