UNPKG

@wix/css-property-parser

Version:

A comprehensive TypeScript library for parsing and serializing CSS property values with full MDN specification compliance

30 lines (29 loc) 1.15 kB
// CSS border-bottom-right-radius physical property parser // https://developer.mozilla.org/en-US/docs/Web/CSS/border-bottom-right-radius import { parsePhysicalBorderRadiusProperty, physicalBorderRadiusToCSSValue } from './shared-physical-border-radius.js'; /** * Parse border-bottom-right-radius value * @param value - The CSS value to parse * @returns Parsed value or null if invalid * * @example * parse('10px') // { type: 'length', value: 10, unit: 'px' } * parse('50%') // { type: 'percentage', value: 50, unit: '%' } * parse('inherit') // { type: 'keyword', keyword: 'inherit' } */ export function parse(value) { return parsePhysicalBorderRadiusProperty(value); } /** * Convert parsed border-bottom-right-radius value to CSS string * @param parsed - The parsed value to convert * @returns CSS string or null if invalid * * @example * toCSSValue({ type: 'length', value: 10, unit: 'px' }) // '10px' * toCSSValue({ type: 'percentage', value: 50, unit: '%' }) // '50%' * toCSSValue({ type: 'keyword', keyword: 'inherit' }) // 'inherit' */ export function toCSSValue(parsed) { return physicalBorderRadiusToCSSValue(parsed); }