securityos/node_modules/framer-motion/dist/es/render/dom/utils/is-css-variable.mjs

7 lines
390 B
JavaScript

const checkStringStartsWith = (token) => (key) => typeof key === "string" && key.startsWith(token);
const isCSSVariableName = checkStringStartsWith("--");
const isCSSVariableToken = checkStringStartsWith("var(--");
const cssVariableRegex = /var\s*\(\s*--[\w-]+(\s*,\s*(?:(?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)+)?\s*\)/g;
export { cssVariableRegex, isCSSVariableName, isCSSVariableToken };