@wix/css-property-parser
Version:
A comprehensive TypeScript library for parsing and serializing CSS property values with full MDN specification compliance
27 lines (26 loc) • 1.12 kB
TypeScript
import type { OverflowValue } from '../types';
type OverflowValueUnion = OverflowValue;
/**
* Parses a CSS overflow property value according to MDN specification
*
* Supports:
* - visible: Content is not clipped and may overflow the container
* - hidden: Content is clipped to the container with no scrolling mechanism
* - scroll: Content is clipped with scrollbars always visible
* - auto: Content is clipped with scrollbars shown only when needed
* - clip: Content is clipped with no scrolling mechanism (newer value)
* - Global keywords: inherit, initial, unset, revert, revert-layer
* - CSS variables: var(--custom-overflow)
*
* @param value - The CSS value to parse
* @returns Parsed OverflowValue or null if invalid
*/
export declare function parse(value: string): OverflowValueUnion | null;
/**
* Converts a parsed OverflowValue back to CSS string representation
*
* @param parsed - The parsed overflow value
* @returns CSS value string or null if invalid
*/
export declare function toCSSValue(parsed: OverflowValueUnion | null): string | null;
export type { OverflowValue } from '../types';