Initial commit
This commit is contained in:
15
node_modules/framer-motion/dist/es/render/dom/utils/is-css-variable.mjs
generated
vendored
Normal file
15
node_modules/framer-motion/dist/es/render/dom/utils/is-css-variable.mjs
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
const checkStringStartsWith = (token) => (key) => typeof key === "string" && key.startsWith(token);
|
||||
const isCSSVariableName =
|
||||
/*@__PURE__*/ checkStringStartsWith("--");
|
||||
const startsAsVariableToken =
|
||||
/*@__PURE__*/ checkStringStartsWith("var(--");
|
||||
const isCSSVariableToken = (value) => {
|
||||
const startsWithToken = startsAsVariableToken(value);
|
||||
if (!startsWithToken)
|
||||
return false;
|
||||
// Ensure any comments are stripped from the value as this can harm performance of the regex.
|
||||
return singleCssVariableRegex.test(value.split("/*")[0].trim());
|
||||
};
|
||||
const singleCssVariableRegex = /var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;
|
||||
|
||||
export { isCSSVariableName, isCSSVariableToken };
|
||||
Reference in New Issue
Block a user