@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) • 918 B
JavaScript
;
// Max-inline-size property parser
// https://developer.mozilla.org/en-US/docs/Web/CSS/max-inline-size
Object.defineProperty(exports, "__esModule", { value: true });
exports.parse = parse;
exports.toCSSValue = toCSSValue;
const types_1 = require('../types.cjs');
const shared_sizing_1 = require('./shared-sizing.cjs');
/**
* Parses a CSS max-inline-size property value into structured components
* @param value - The CSS max-inline-size property string
* @returns Parsed max-inline-size object or null if invalid
*/
function parse(value) {
return (0, shared_sizing_1.parseSizingProperty)(value, types_1.MAX_SIZING_KEYWORDS, true);
}
/**
* Converts a parsed max-inline-size value back to a CSS string
* @param parsed - The parsed max-inline-size object
* @returns CSS value string or null if invalid
*/
function toCSSValue(parsed) {
return (0, shared_sizing_1.sizingToCSSValue)(parsed);
}