-
Notifications
You must be signed in to change notification settings - Fork 711
[css-anchor-position-1] Reusing the implicit anchor name on the nested elements #8913
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
Comments
An easy fix, at least for your use case, would be saying a Or if we want any child element to be able to use its parent's implicit anchor, then this may be solved by @tabatkins's proposal in #8181 The proposal says whenever we have an anchor element reference (either by implicit anchor, Then we can do something like
|
I like the idea of a Though, in some cases we could want a more complicated structure, where we would have to use an actual extra element. In that case the proposal which would make the |
Oooh yeah, that would work for a general solution, interesting. I think you pushed back on #8181 earlier for impl reasons - any new thoughts?
This is a pretty good narrow solution, tho. This feels like it should be pretty straightforward, so I'll just add it. |
Still really hard to implement. |
…nt's implicit anchor See w3c/csswg-drafts#8913 for more details. Fixed: 1455563 Change-Id: I8e37ff58bb77f1850e46c88d9ff66cc0bb58bca8
In the OpenUI discord there was a question by @o-t-w about a certain common use case for the
I tested it, and managed to re-create this effect with a |
…nt's implicit anchor See w3c/csswg-drafts#8913 for more details. Fixed: 1455563 Change-Id: I8e37ff58bb77f1850e46c88d9ff66cc0bb58bca8 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4622093 Reviewed-by: Joey Arhar <[email protected]> Commit-Queue: Xiaocheng Hu <[email protected]> Cr-Commit-Position: refs/heads/main@{#1160220}
…nt's implicit anchor See w3c/csswg-drafts#8913 for more details. Fixed: 1455563 Change-Id: I8e37ff58bb77f1850e46c88d9ff66cc0bb58bca8 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4622093 Reviewed-by: Joey Arhar <[email protected]> Commit-Queue: Xiaocheng Hu <[email protected]> Cr-Commit-Position: refs/heads/main@{#1160220}
…nt's implicit anchor See w3c/csswg-drafts#8913 for more details. Fixed: 1455563 Change-Id: I8e37ff58bb77f1850e46c88d9ff66cc0bb58bca8 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4622093 Reviewed-by: Joey Arhar <[email protected]> Commit-Queue: Xiaocheng Hu <[email protected]> Cr-Commit-Position: refs/heads/main@{#1160220}
^ Adding |
…fter to use originating element's implicit anchor, a=testonly Automatic update from web-platform-tests [anchor-position] Allow ::before and ::after to use originating element's implicit anchor See w3c/csswg-drafts#8913 for more details. Fixed: 1455563 Change-Id: I8e37ff58bb77f1850e46c88d9ff66cc0bb58bca8 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4622093 Reviewed-by: Joey Arhar <[email protected]> Commit-Queue: Xiaocheng Hu <[email protected]> Cr-Commit-Position: refs/heads/main@{#1160220} -- wpt-commits: 1a07e5d0574ee0158eb5e854ee90174c3c98bbe1 wpt-pr: 40608
…fter to use originating element's implicit anchor, a=testonly Automatic update from web-platform-tests [anchor-position] Allow ::before and ::after to use originating element's implicit anchor See w3c/csswg-drafts#8913 for more details. Fixed: 1455563 Change-Id: I8e37ff58bb77f1850e46c88d9ff66cc0bb58bca8 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4622093 Reviewed-by: Joey Arhar <jarharchromium.org> Commit-Queue: Xiaocheng Hu <xiaochenghchromium.org> Cr-Commit-Position: refs/heads/main{#1160220} -- wpt-commits: 1a07e5d0574ee0158eb5e854ee90174c3c98bbe1 wpt-pr: 40608 UltraBlame original commit: 314d383374dff8b8fd44762576b52e25caac3c2a
…fter to use originating element's implicit anchor, a=testonly Automatic update from web-platform-tests [anchor-position] Allow ::before and ::after to use originating element's implicit anchor See w3c/csswg-drafts#8913 for more details. Fixed: 1455563 Change-Id: I8e37ff58bb77f1850e46c88d9ff66cc0bb58bca8 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4622093 Reviewed-by: Joey Arhar <jarharchromium.org> Commit-Queue: Xiaocheng Hu <xiaochenghchromium.org> Cr-Commit-Position: refs/heads/main{#1160220} -- wpt-commits: 1a07e5d0574ee0158eb5e854ee90174c3c98bbe1 wpt-pr: 40608 UltraBlame original commit: 314d383374dff8b8fd44762576b52e25caac3c2a
…fter to use originating element's implicit anchor, a=testonly Automatic update from web-platform-tests [anchor-position] Allow ::before and ::after to use originating element's implicit anchor See w3c/csswg-drafts#8913 for more details. Fixed: 1455563 Change-Id: I8e37ff58bb77f1850e46c88d9ff66cc0bb58bca8 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4622093 Reviewed-by: Joey Arhar <jarharchromium.org> Commit-Queue: Xiaocheng Hu <xiaochenghchromium.org> Cr-Commit-Position: refs/heads/main{#1160220} -- wpt-commits: 1a07e5d0574ee0158eb5e854ee90174c3c98bbe1 wpt-pr: 40608 UltraBlame original commit: 314d383374dff8b8fd44762576b52e25caac3c2a
(Reviewed this with Elika today, we're both good with it.) |
We currently can use the implicit anchor element provided by the
anchor
attribute associated with someid
. This would be mainly used for popovers (though, at least the current implementation in Chrome Canary allows this attribute and its implicit anchor on any element).The issue is: we currently seem to only be able to use this implicit anchor on the element itself, but we don't have access to it in any other way?
What we could want is to somehow access this anchor from elements or pseudo-elements nested inside our popover (or another element with
anchor
on it). This can be useful when we'd want to use this element as the tooltip arrow or another connector that should span from the popover's anchor to the popover itself.Here is an implementation of how this should work: https://codepen.io/kizu/pen/qBJQpjm?editors=1100 — using both the
anchor
attribute, and the explicitly setanchor-name
s.(note that there is currently a bug where we have to use the
anchor
attribute even if we do not use the implicit anchor and override it with theanchor-default
— https://bugs.chromium.org/p/chromium/issues/detail?id=1451095)In the example above we'd want to have an element that is nested inside the popover and which spans from it to the button it is anchored with via an
anchor
attribute.If we'd use an additional element, we could add the same
anchor
attribute, but that would mean duplicating things.Some ideas of possible solutions:
The text was updated successfully, but these errors were encountered: