Re: [csswg-drafts] [css-anchor] Detecting active @position-fallback (#8171)

I think using something like CQ here is the way, though the tricky thing is the size containment.

The way I think could be the most powerful while avoiding any circularity: an ability to query any container's _closest used fallback_. Critically, not the fallback used on the container itself, as allowing the containment on the children of the positioned element can make things more flexible.

```HTML
<div popover>
  <div class="decorations"></div>
  Some content
</div>
```

With this HTML, for example, we will have a popover which uses some list of fallbacks, and then what we could do is position the `.decorations` with `inset: 0` over the popover, make it a container, and then any pseudo-element (or element) inside this container could query the fallback.

Of course, if the popover itself could be made a container, any children could query the fallback directly, but that will come with more limitations, so an ability to separate the containers from the fallbacks they query could be the most flexible way to go.


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


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

Received on Tuesday, 13 February 2024 14:28:30 UTC