UNPKG

motion

Version:

The Motion library for the web

19 lines (16 loc) 549 B
import { isCssVar } from './utils/css-var.es.js'; import { transformPropertyDefinitions } from './utils/transforms.es.js'; const style = { get: (element, name) => { let value = isCssVar(name) ? element.style.getPropertyValue(name) : getComputedStyle(element)[name]; if (!value && value !== 0) { const definition = transformPropertyDefinitions.get(name); if (definition) value = definition.initialValue; } return value; }, }; export { style };