@wix/css-property-parser
Version:
A comprehensive TypeScript library for parsing and serializing CSS property values with full MDN specification compliance
25 lines (24 loc) • 846 B
JavaScript
// Logical margin-inline-end property evaluator
// Defines the logical inline end margin of an element, adapting to writing mode and direction
// MDN: https://developer.mozilla.org/en-US/docs/Web/CSS/margin-inline-end
import { parseMarginProperty, marginToCSSValue } from './shared-margin.js';
/**
* Parses CSS margin-inline-end property value
*
* Syntax: <length-percentage> | auto | global-keywords
*
* @param value - The CSS value to parse
* @returns Parsed margin-inline-end value or null if invalid
*/
export function parse(value) {
return parseMarginProperty(value);
}
/**
* Converts parsed margin-inline-end value back to CSS string
*
* @param parsed - The parsed margin-inline-end value
* @returns CSS string representation or null if invalid
*/
export function toCSSValue(parsed) {
return marginToCSSValue(parsed);
}