Skip to content

Commit

Permalink
Merge pull request #463 from code-hike/cancel-animations
Browse files Browse the repository at this point in the history
Fix color measurement in token-transitions
  • Loading branch information
pomber authored Oct 2, 2024
2 parents 496d34c + 70f8de6 commit e79de05
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/wild-tables-fail.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"codehike": patch
---

Fix color measurement in token-transitions
1 change: 1 addition & 0 deletions packages/codehike/src/utils/token-transitions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e79de05

Please sign in to comment.