UNPKG

@builder.io/mitosis

Version:

Write components once, run everywhere. Compiles to Vue, React, Solid, and Liquid. Import code from Figma and Builder.io

16 lines (15 loc) 565 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.extractCssVarDefaultValue = void 0; function extractCssVarDefaultValue(value) { // Regular expression to find var() expressions const varRegex = /var\(--[^,]+?,\s*([^)]+)\)/; // Function to replace var() with its fallback let newValue = value; let match; while ((match = newValue.match(varRegex))) { newValue = newValue.replace(match[0], match[1].trim()); } return newValue; } exports.extractCssVarDefaultValue = extractCssVarDefaultValue;