@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.2 kB
JavaScript
;
// Border-right-style property evaluator
// https://developer.mozilla.org/en-US/docs/Web/CSS/border-right-style
Object.defineProperty(exports, "__esModule", { value: true });
exports.parse = parse;
exports.toCSSValue = toCSSValue;
const shared_border_style_1 = require('./shared-border-style.cjs');
/**
* Parse CSS border-right-style property
*
* @param value - CSS border-right-style property value
* @returns Parsed border style value or null if invalid
*
* @example
* parse('solid') // { type: 'keyword', keyword: 'solid' }
* parse('dashed') // { type: 'keyword', keyword: 'dashed' }
* parse('var(--style)') // null (CSS variables handled at runtime)
*/
function parse(value) {
return (0, shared_border_style_1.parseBorderStyleProperty)(value);
}
/**
* Convert parsed border-right-style back to CSS string
*
* @param parsed - Parsed border style value
* @returns CSS string representation or null if invalid
*
* @example
* toCSSValue({ type: 'keyword', keyword: 'dashed' }) // 'dashed'
* toCSSValue({ type: 'keyword', keyword: 'initial' }) // 'initial'
*/
function toCSSValue(parsed) {
return (0, shared_border_style_1.borderStyleToCSSValue)(parsed);
}