motion
Version:
The Motion library for the web
24 lines (21 loc) • 675 B
JavaScript
import { transformPropertyDefinitions } from './transforms.es.js';
const isCssVar = (name) => name.startsWith("--");
const registeredProperties = new Set();
function registerCssVariable(name) {
if (registeredProperties.has(name))
return;
registeredProperties.add(name);
try {
const { syntax, initialValue } = transformPropertyDefinitions.has(name)
? transformPropertyDefinitions.get(name)
: {};
CSS.registerProperty({
name,
inherits: false,
syntax,
initialValue,
});
}
catch (e) { }
}
export { isCssVar, registerCssVariable, registeredProperties };