@wordpress/components
Version:
UI components for WordPress.
22 lines (20 loc) • 647 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.isSimpleCssValue = isSimpleCssValue;
/**
* Internal dependencies
*/
/**
* Some themes use css vars for their font sizes, so until we
* have the way of calculating them don't display them.
*
* @param value The value that is checked.
* @return Whether the value is a simple css value.
*/
function isSimpleCssValue(value) {
const sizeRegex = /^[\d\.]+(px|em|rem|vw|vh|%|svw|lvw|dvw|svh|lvh|dvh|vi|svi|lvi|dvi|vb|svb|lvb|dvb|vmin|svmin|lvmin|dvmin|vmax|svmax|lvmax|dvmax)?$/i;
return sizeRegex.test(String(value));
}
//# sourceMappingURL=utils.js.map