Skip to content

Commit 15fcd3d

Browse files
committed
[css-anchor-1] Whoops, forgot that position fallback immediately overrides base styles, rather than using base styles as the first entry. w3c#7757
1 parent 5b063f5 commit 15fcd3d

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

css-anchor-1/Overview.bs

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -314,11 +314,19 @@ is equivalent to ''top: anchor(top);'',
314314
etc.
315315

316316
Additionally,
317-
it automatically adds one entry
318-
to the beginning of the element's [=position fallback list=]
319-
(preceding any entries added by 'position-fallback'),
320-
swapping the value of the [=inset property=] it's used in
321-
and the opposite [=inset property=].
317+
if the element has ''position-fallback: none'',
318+
[=automatic anchor positioning=] causes the element
319+
to gain a [=position fallback list=]
320+
consisting of two entries:
321+
322+
* one containing all the base-style properties on the element
323+
that are valid to use in ''@try'' rules,
324+
with ''anchor()/auto''/''auto-same'' keywords
325+
resolved to their appropriate side.
326+
* one containing the same,
327+
but with the [=inset properties=] in each axis swapped,
328+
and the ''anchor()/auto''/''auto-same'' keywords
329+
resolved to the opposite sides as well.
322330

323331
<div class=example>
324332
For example, the following code using [=automatic anchor positioning=]:
@@ -335,10 +343,13 @@ and the opposite [=inset property=].
335343
<pre highlight=css>
336344
.foo {
337345
position: absolute;
338-
top: calc(.5em + anchor(--foo bottom));
339346
position-fallback: --flip;
340347
}
341348
@position-fallback --flip {
349+
@try {
350+
top: calc(.5em + anchor(--foo bottom));
351+
bottom: auto;
352+
}
342353
@try {
343354
top: auto;
344355
bottom: calc(.5em + anchor(--foo top));

0 commit comments

Comments
 (0)