@wix/css-property-parser
Version:
A comprehensive TypeScript library for parsing and serializing CSS property values with full MDN specification compliance
35 lines (34 loc) • 1.39 kB
JavaScript
;
// CSS border-start-start-radius logical property parser
// Maps to physical border radius properties based on writing mode and direction
// https://developer.mozilla.org/en-US/docs/Web/CSS/border-start-start-radius
Object.defineProperty(exports, "__esModule", { value: true });
exports.parse = parse;
exports.toCSSValue = toCSSValue;
const shared_logical_border_radius_1 = require('./shared-logical-border-radius.cjs');
/**
* Parse border-start-start-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' }
*/
function parse(value) {
return (0, shared_logical_border_radius_1.parseLogicalBorderRadiusProperty)(value);
}
/**
* Convert parsed border-start-start-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'
*/
function toCSSValue(parsed) {
return (0, shared_logical_border_radius_1.logicalBorderRadiusToCSSValue)(parsed);
}