Skip to content

feat: add match-element as an explicit ViewTransitionName variant#1274

Open
PranavAchar01 wants to merge 1 commit into
parcel-bundler:masterfrom
PranavAchar01:fix/1256-view-transition-match-element
Open

feat: add match-element as an explicit ViewTransitionName variant#1274
PranavAchar01 wants to merge 1 commit into
parcel-bundler:masterfrom
PranavAchar01:fix/1256-view-transition-match-element

Conversation

@PranavAchar01

Copy link
Copy Markdown

Summary

Fixes #1256.

match-element is a new keyword in the CSS View Transitions Level 2 spec that sets an element's view-transition-name to a value derived from its identity (rather than an author-chosen name).

Before this change the keyword had no explicit enum variant and fell through to Custom(CustomIdent). This caused two problems:

  • CSS Modules scoping would rename match-element as if it were an author identifier.
  • Serialization would emit it as a custom ident rather than a reserved keyword.

Fix: add a MatchElement variant between Auto and Custom in ViewTransitionName. The #[derive(Parse, ToCss)] macros already handle the kebab-case round-trip automatically.

Test plan

  • cargo test passes (119/119 lib tests)
  • Added a CSS modules test confirming match-element is preserved verbatim and not renamed

🤖 Generated with Claude Code

`match-element` is a new keyword in the CSS View Transitions Level 2 spec
that derives an element's view-transition-name from its identity. Without
this variant it fell through to `Custom(CustomIdent)` and was erroneously
renamed when CSS Modules scoping was enabled.

Fixes parcel-bundler#1256.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

view-transition-name: match-element is incorrectly transformed

1 participant