Skip to content

fix(animated-theme-toggler): use percentage clip-path coordinates for view transition#990

Merged
Yeom-JinHo merged 1 commit into
magicuidesign:mainfrom
Yeom-JinHo:fix/issue-989-vt-clip-path-percentage
Jul 20, 2026
Merged

fix(animated-theme-toggler): use percentage clip-path coordinates for view transition#990
Yeom-JinHo merged 1 commit into
magicuidesign:mainfrom
Yeom-JinHo:fix/issue-989-vt-clip-path-percentage

Conversation

@Yeom-JinHo

Copy link
Copy Markdown
Member

Fixes #989

Problem: Chrome 150 renders absolute px clip-path coordinates on ::view-transition-new(root) without applying the display scale factor on the first view transition after page load. On fractional display scales (Windows 150%, devicePixelRatio 1.5) the first wipe starts at exactly coordinate / 1.5 — confirmed by the reporter's environment details in the issue. Subsequent transitions are fine; Firefox is unaffected.

Fix: Express all clip-path geometry (circle center/radius and every polygon vertex across all 7 variants) as percentages of the snapshot reference box instead of px. Percentages resolve relative to the reference box, so they stay correct regardless of how Chrome scales the snapshot. Viewport denominators switch from visualViewport to innerWidth/innerHeight to match the reference box (includes classic scrollbars).

No visual change in unaffected browsers — the percentages resolve to identical geometry.

Verified: keyframe values and frame-by-frame wipe position checked on Chrome 150 (macOS, native DPR 2 and forced DSF 1.5) for circle + polygon variants; typecheck + registry rebuild pass. The actual bug environment (Windows + 150% scale) can't be reproduced on macOS — @jimfaster, could you verify this preview against your setup?

🤖 Generated with Claude Code

https://claude.ai/code/session_01RDrm9vajALhxeHspRH68jj

… view transition

Chrome 150 renders absolute px clip-path coordinates on
::view-transition-new(root) without applying the display scale factor on
the first transition after page load, so on fractional scales (e.g.
Windows 150%, devicePixelRatio 1.5) the first wipe starts at the wrong
position — both coordinates land at exactly value/1.5 (magicuidesign#989).

Express the whole clip-path geometry (circle center/radius and all
polygon vertices across every variant) as percentages of the snapshot
reference box instead of px. Percentages are resolved relative to the
reference box, so they stay correct regardless of how Chrome scales the
snapshot, on the first and every subsequent transition. Viewport
denominators switch from visualViewport to innerWidth/innerHeight to
match the reference box, which includes classic scrollbars.

No visual change in unaffected browsers: the percentages resolve to the
same geometry the px values produced.

Fixes magicuidesign#989

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RDrm9vajALhxeHspRH68jj
@vercel

vercel Bot commented Jul 20, 2026

Copy link
Copy Markdown

@Yeom-JinHo is attempting to deploy a commit to the product-studio Team on Vercel.

A member of the Team first needs to authorize it.

@Yeom-JinHo
Yeom-JinHo merged commit 03ab29b into magicuidesign:main Jul 20, 2026
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug]: Theme toggler is now broken because of Chrome update

1 participant