Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[css-view-transitions-2] Add a way to auto-generate view transition names for single page transitions #10148

Closed
nt1m opened this issue Mar 27, 2024 · 2 comments
Labels
css-view-transitions-2 View Transitions; New feature requests

Comments

@nt1m
Copy link
Member

nt1m commented Mar 27, 2024

This type of CSS isn't particularly great for single page transitions:

	.card:nth-child(1) { view-transition-name: card-1; }
	.card:nth-child(2) { view-transition-name: card-2; }
	.card:nth-child(3) { view-transition-name: card-3; }
	.card:nth-child(4) { view-transition-name: card-4; }
	.card:nth-child(5) { view-transition-name: card-5; }
	.card:nth-child(6) { view-transition-name: card-6; }
	.card:nth-child(7) { view-transition-name: card-7; }
	.card:nth-child(8) { view-transition-name: card-8; }
	.card:nth-child(9) { view-transition-name: card-9; }
	.card:nth-child(10) { view-transition-name: card-10; }
	.card:nth-child(11) { view-transition-name: card-11; }
	.card:nth-child(12) { view-transition-name: card-12; }
	.card:nth-child(13) { view-transition-name: card-13; }
	.card:nth-child(14) { view-transition-name: card-14; }
	.card:nth-child(15) { view-transition-name: card-15; }
	.card:nth-child(16) { view-transition-name: card-16; }
	.card:nth-child(17) { view-transition-name: card-17; }

It would be good if the reserved auto keyword could be leveraged here to do this:

.card { view-transition-name: auto; }

or such.

One concern that was brought up is that it wouldn't be possible to automatically to do this for cross-document transitions, but I doubt that is a significant issue, but this is pretty useful by itself even just for single-page ones.

cc @khushalsagar @vmpstr @noamr @fantasai @jensimmons

@nt1m nt1m added the css-view-transitions-2 View Transitions; New feature requests label Mar 27, 2024
@noamr
Copy link
Collaborator

noamr commented Mar 27, 2024

I think this is a duplicate of #8320. Let's continue the discussion there? Glad to see you're interested in this @nt1m

@nt1m nt1m closed this as completed Mar 27, 2024
@jensimmons
Copy link
Contributor

I added this comment: #8320 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
css-view-transitions-2 View Transitions; New feature requests
Projects
None yet
Development

No branches or pull requests

3 participants