diff --git a/index.html b/index.html index f570dfbe..4441d27b 100644 --- a/index.html +++ b/index.html @@ -31,6 +31,7 @@ + @@ -682,13 +684,27 @@

- Dynamically update anchors + Dynamically updated anchors

Anchor
Target
+

With polyfill applied: Target and Anchor's right edges line up. Target's top edge lines up with the bottom edge of the Anchor. @@ -768,6 +784,66 @@

position: absolute; top: anchor(--my-anchor-absolute bottom); left: anchor(--my-anchor-absolute right); +} +

+
+

+ + Dynamically added anchors +

+
+
Original Anchor
+
Target
+
+ + +

+ With polyfill applied: Target and original Anchor's right edges line up. + Target's top edge lines up with the top edge of the original Anchor. +
+
+ When another valid Anchor is added earlier in the DOM order and the + polyfill is re-applied, Target position updates relative to the added + Anchor. +

+
#my-anchor-added-new {
+  anchor-name: --my-anchor-added;
+  margin-bottom: 1rem;
+}
+
+#my-anchor-added-original {
+  anchor-name: --my-anchor-added;
+}
+
+#my-target-added {
+  position: absolute;
+  left: anchor(--my-anchor-added right);
+  top: anchor(--my-anchor-added top);
 }