Skip to content

Commit ab8d576

Browse files
authored
Added a section about ::tether in the anchored queries explainer (w3c#12244)
1 parent 2ba2239 commit ab8d576

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed

css-anchor-position-1/anchored_container_query.md

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
CSS Anchor Positioning Level 1 introduced a way to position and size absolute
66
positioned elements relative to a specific anchor element.
77

8-
Note: This explainer currently does not explore the
9-
[`::tether` proposal](https://github.com/w3c/csswg-drafts/issues/9271).
10-
118
There have been multiple requests to support styling of anchored elements based
129
on the chosen position.
1310

@@ -148,6 +145,28 @@ other fallback rules. See
148145
[The @position-try Rule](https://drafts.csswg.org/css-anchor-position-1/#fallback-rule)
149146
150147
148+
## ::tether
149+
150+
There is an [alternative proposal](https://github.com/w3c/csswg-drafts/issues/9271)
151+
to introduce a `::tether` pseudo element for the tether rendering use case
152+
specifically.
153+
154+
Having a separate pseudo element for tethers could make them more convenient
155+
for authors to create if it is possible to construct UA styles which gives a
156+
sensible behavior for sizing and positioning in more than just the trivial use
157+
cases. As can be seen from
158+
[explorations in the issue](https://github.com/w3c/csswg-drafts/issues/9271#issuecomment-1721772484),
159+
this is complicated.
160+
161+
The codepen demo in the section below uses the `::after` element in the
162+
anchored element to render the tether. One thing to point out from the
163+
`::tether` proposal is that it is pulling the box for the pseudo element out as
164+
a sibling of its originating element, which is something one cannot do with the
165+
container query proposed here. However, pulling the box out like that is known
166+
to have [issues](https://github.com/w3c/csswg-drafts/issues/11213) with e.g.
167+
size container queries. It is not unlikely that an author would want the tether
168+
to respond to size queries on the anchored element.
169+
151170
## Use Cases and Author Requests
152171
153172
- https://github.com/w3c/csswg-drafts/issues/8171#issue-1472061771

0 commit comments

Comments
 (0)