@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) • 952 B
TypeScript
import { type BorderStylePropertyValue } from './shared-border-style';
export type BorderTopStyleValue = BorderStylePropertyValue;
/**
* Parse CSS border-top-style property
*
* @param value - CSS border-top-style property value
* @returns Parsed border style value or null if invalid
*
* @example
* parse('solid') // { type: 'keyword', keyword: 'solid' }
* parse('none') // { type: 'keyword', keyword: 'none' }
* parse('var(--style)') // null (CSS variables handled at runtime)
*/
export declare function parse(value: string): BorderTopStyleValue;
/**
* Convert parsed border-top-style back to CSS string
*
* @param parsed - Parsed border style value
* @returns CSS string representation or null if invalid
*
* @example
* toCSSValue({ type: 'keyword', keyword: 'solid' }) // 'solid'
* toCSSValue({ type: 'keyword', keyword: 'inherit' }) // 'inherit'
*/
export declare function toCSSValue(parsed: BorderTopStyleValue): string | null;