@wix/css-property-parser
Version:
A comprehensive TypeScript library for parsing and serializing CSS property values with full MDN specification compliance
26 lines (25 loc) • 953 B
TypeScript
import { type TextOverflowValue } from '../types';
/**
* Parses CSS text-overflow property values
*
* Syntax: clip | ellipsis | <string> | inherit | initial | unset | revert
*
* @param value - The CSS text-overflow value to parse
* @returns Parsed TextOverflowValue or null if invalid
*
* @example
* ```typescript
* parse('clip') // { type: 'keyword', keyword: 'clip' }
* parse('ellipsis') // { type: 'keyword', keyword: 'ellipsis' }
* parse('inherit') // { type: 'keyword', keyword: 'inherit' }
* parse('var(--my-overflow)') // { type: 'css-variable', variable: 'my-overflow' }
* ```
*/
export declare function parse(value: string): TextOverflowValue | null;
/**
* Converts a parsed TextOverflowValue back to its CSS string representation
*
* @param value - The parsed text-overflow value
* @returns CSS string representation or null if invalid
*/
export declare function toCSSValue(value: TextOverflowValue | null): string | null;