- From: Noam Rosenthal via GitHub <sysbot+gh@w3.org>
- Date: Fri, 05 Jan 2024 10:13:17 +0000
- To: public-css-archive@w3.org
> > ([#](https://github.com/w3c/csswg-drafts/issues/8320#issuecomment-1877522852)) I wonder what people think about an idea like this:
> > `section.list li.item[:id] img { view-transition-name: item-[:id] }`
> > Where the attributes are captured in the selector chain and then used to generate a name.
>
> Interesting. I like how this allows you to capture an attribute from a parent element and use that on a child. With `attr()` that’s not immediately possible, unless you jump through some hoops using a custom property.
>
> Two thoughts:
>
> * I would use something different than `:` to capture it, as it could be confused with pseudos. Am thinking of an `@` right now:
> ```css
> section.list li.item[@id] { … }
> ```
> * To use it in an ident, I think we’d still need somethink like [[css-values] A way to dynamically construct custom-ident and dashed-ident values #9141](https://github.com/w3c/csswg-drafts/issues/9141) to dynamically construct the resulting ident.
> ```css
> section.list li.item[@id] {
> view-transition-name: ident("item-" @id);
> }
> ```
Isn't the `ident` function redundant though? why not `"item-" @id` or `item-(@id)` or something like that?
--
GitHub Notification of comment by noamr
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/8320#issuecomment-1878429125 using your GitHub account
--
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Friday, 5 January 2024 10:13:19 UTC