diff --git a/.changeset/wild-tables-fail.md b/.changeset/wild-tables-fail.md new file mode 100644 index 00000000..b95ee994 --- /dev/null +++ b/.changeset/wild-tables-fail.md @@ -0,0 +1,5 @@ +--- +"codehike": patch +--- + +Fix color measurement in token-transitions diff --git a/packages/codehike/src/utils/token-transitions.tsx b/packages/codehike/src/utils/token-transitions.tsx index 2eff3080..77a93653 100644 --- a/packages/codehike/src/utils/token-transitions.tsx +++ b/packages/codehike/src/utils/token-transitions.tsx @@ -241,6 +241,7 @@ function toSnapshotElement(el: HTMLElement): SnapshotElement { y += p.offsetTop p = p.offsetParent } + el?.getAnimations().forEach((a) => a.cancel()) const style = window.getComputedStyle(el) const color = style.color const content = el.textContent