Re: [csswg-drafts] [css-anchor-1] Transitioning when the anchor element with a given name changes (#8181)

<details>
<summary>Disclaimer and additional links</summary>

I'm submitting my feedback following my experiments with the current implementation of anchor positioning in Chrome Canary.

I wrote an article about my experiments, but decided to fill most of my feedback as separate issues here.

A quick summary of related links:

- [anchor positioning specs](https://drafts.csswg.org/css-anchor-position-1/)
- [my article with the experiments](https://kizu.dev/anchor-positioning-experiments/)
</details>

I'm using this issue instead of creating a new one in order not to duplicate things. The issue topic that I wanted to give — “[css-anchor-1] Transitions when moving the anchor-name”.

I did experiment a bit with transitions, and found the same case that works — having multiple elements with different `anchor-name`s, then using a CSS variable for the `anchor()` and dynamically adjusting the value of this variable.

The experiment in question: https://kizu.dev/anchor-positioning-experiments/#transitions

In my case, initially I wanted to instead change to which element the static `anchor-name` is applied — so the `anchor()` would not (necessarily) be a CSS variable, but at any given moment different elements could become the target via moving the “anchor-name” itself from element to an element.

This way the case for my transition would've been significantly simplified.

Here is a CodePen with just the reproducible cases which work and which does not: https://codepen.io/kizu/pen/RwYMmmp

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


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

Received on Wednesday, 15 March 2023 12:24:02 UTC