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

7 lines
390 B
JavaScript
Raw Permalink Normal View History

2024-09-06 15:32:35 +00:00
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 };