motion-dom 13.3.0 → 13.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/index.js CHANGED
@@ -5310,13 +5310,14 @@ const addSVGValue = (element, state, key, value) => {
5310
5310
  else if (key.startsWith("attr")) {
5311
5311
  return addAttrValue(element, state, key, value, convertAttrKey(key));
5312
5312
  }
5313
- const handler = key in element.style ? addStyleValue : addAttrValue;
5313
+ const handler = isCSSVar(key) || key in element.style ? addStyleValue : addAttrValue;
5314
5314
  return handler(element, state, key, value);
5315
5315
  };
5316
5316
  /**
5317
5317
  * Reads the current value of `key` from an SVG element as the origin of
5318
5318
  * an animation, as the SVG VisualElement does: transforms start from
5319
- * their defaults, the few CSS-only properties come from computed style
5319
+ * their defaults, CSS variables and the few CSS-only properties come from
5320
+ * computed style
5320
5321
  * and everything else is read from the attribute, dash-cased
5321
5322
  * (`strokeWidth` -> `stroke-width`) or, failing that, as written
5322
5323
  * (`baseFrequency`).
@@ -5325,7 +5326,7 @@ const readSVGValue = (element, key) => {
5325
5326
  if (transformProps.has(key)) {
5326
5327
  return numberValueTypes[key]?.default || 0;
5327
5328
  }
5328
- if (cssStyleProperties.includes(key)) {
5329
+ if (isCSSVar(key) || cssStyleProperties.includes(key)) {
5329
5330
  return readStyleValue(element, key);
5330
5331
  }
5331
5332
  key = convertAttrKey(key);