Skip to content

Commit e79de05

Browse files
authored
Merge pull request #463 from code-hike/cancel-animations
Fix color measurement in token-transitions
2 parents 496d34c + 70f8de6 commit e79de05

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

.changeset/wild-tables-fail.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"codehike": patch
3+
---
4+
5+
Fix color measurement in token-transitions

packages/codehike/src/utils/token-transitions.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ function toSnapshotElement(el: HTMLElement): SnapshotElement {
241241
y += p.offsetTop
242242
p = p.offsetParent
243243
}
244+
el?.getAnimations().forEach((a) => a.cancel())
244245
const style = window.getComputedStyle(el)
245246
const color = style.color
246247
const content = el.textContent

0 commit comments

Comments
 (0)