Re: [csswg-drafts] [css-view-transitions-2] Allow an auto-generated `view-transition-name` that doesn't default to ID (#10995)

> @jakearchibald It's not good to fixate on complex websites with complex underlying infrastructure. Sure, there a many websites that use a framework that can enable SPA or MPA rendering, and will switch between them. But there are also many smaller sites that are not so complicated, designers who are working in much simpler environments, and we want CSS to be designed to be simple and easy for them to use, too.

I don't think it's correct to treat this as a dichotomy. We want CSS to work well for the simple cases while not creating inconsistent and confusing behavior for the more complicated ones. A lot of developers find themselves somewhere in between.

> 
> In CSS we try to make it easy to do the obvious thing. If I gave you (a human, not a computer system) a DOM tree and a change function, and said, "do the obvious thing to match the elements across the changes I made", then using whichever of element identity or element ID was available would be pretty reasonable, right?

Still, CSS has a clear separation between DOM and styling, with a new and very explicit exception (`attr`).

> 
> If you want to do something specific, there's syntax to do that specific thing. If that syntax feels awkward, we can improve it. But purpose of an `auto` keyword is to make the obvious thing easy to request, and have the UA figure it out. And that's what it's doing here.

I'm not sure if "match elements by ID and fallback to per-element matching" is "obvious" (on top of a same-document `match-element` behavior). I'd call it "particular". It does the obvious thing only under specific simplified conditions, and that thing is not similar to anything else in CSS. Using a keyword like `auto` to do something this particular and novel doesn't seem right.

(I was not entirely at peace with what we ended up with when we resolved but didn't want to pick that battle, but @jakearchibald's arguments here are good I think).

-- 
GitHub Notification of comment by noamr
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/10995#issuecomment-2452955229 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Saturday, 2 November 2024 11:06:29 UTC