@@ -806,6 +806,57 @@ is ''align-self/normal'':
806
806
it will shift leftwards to stay visible.
807
807
</div>
808
808
809
+
810
+ <!-- Big Text: a-center
811
+
812
+ ███▌ ███▌ █████▌ █ █▌ █████▌ █████▌ ████▌
813
+ ▐█ ▐█ █▌ █▌ █▌ █▌ █▌ █▌ █▌ █▌ █▌
814
+ █▌ █▌ █▌ █▌ ██▌ █▌ █▌ █▌ █▌ █▌
815
+ █▌ █▌ ████▌ █▌ ████ █▌▐█ █▌ █▌ ████ ████▌
816
+ █████▌ █▌ █▌ █▌ ██▌ █▌ █▌ █▌▐█
817
+ █▌ █▌ █▌ █▌ █▌ █▌ █▌ █▌ █▌ █▌ ▐█
818
+ █▌ █▌ ███▌ █████▌ █▌ ▐▌ █▌ █████▌ █▌ █▌
819
+ -->
820
+
821
+ Centering on the Anchor: the ''anchor-center'' alignment value {#anchor-center}
822
+ --------------------------------------------------------------
823
+
824
+ <pre class=propdef>
825
+ Name : justify-self, align-self, justify-items, align-items
826
+ New Values : anchor-center
827
+ </pre>
828
+
829
+ The [=self-alignment properties=] allow an [=absolutely positioned box=]
830
+ to align itself within the [=inset-modified containing block=] .
831
+ The existing values,
832
+ plus carefully chosen [=inset properties=] ,
833
+ are usually enough for useful alignment,
834
+ but a common case for anchored positioning--
835
+ centering over the [=anchor box=] --
836
+ requires careful and somewhat complex set-up to achieve.
837
+
838
+ The new <dfn value for="justify-self, align-self, justify-items, align-items">anchor-center</dfn> value
839
+ makes this case extremely simple:
840
+ if the positioned box has a [=default anchor box=] ,
841
+ then it is centered (insofar as possible)
842
+ over the [=default anchor box=]
843
+ in the relevant axis.
844
+
845
+ Additionally,
846
+ any ''top/auto'' [=inset properties=] resolve to ''0'' .
847
+
848
+ If the box is not [=absolutely positioned=] ,
849
+ or does not have a [=default anchor box=] ,
850
+ this value behaves as ''<self-position>/center''
851
+ and has no additional effect on how [=inset properties=] resolve.
852
+
853
+ Note: When using ''anchor-center'' , by default
854
+ if the anchor is too close to the edge of the box's
855
+ [=original containing block=] ,
856
+ it will “shift” from being purely centered,
857
+ in order to remain within the [=original containing block=] .
858
+ See [[css-align-3#overflow-values]] for more details.
859
+
809
860
<!-- Big Text: anchor()
810
861
811
862
███▌ █ █▌ ███▌ █▌ █▌ ███▌ ████▌ ██ ██
@@ -817,8 +868,8 @@ is ''align-self/normal'':
817
868
█▌ █▌ █▌ ▐▌ ███▌ █▌ █▌ ███▌ █▌ █▌ ██ ██
818
869
-->
819
870
820
- The ''anchor()'' Function {#anchor-pos}
821
- ---------------------------------------------------
871
+ Anchor-relative Insets: the ''anchor()'' function {#anchor-pos}
872
+ -------------------------------------------------
822
873
823
874
An [=absolutely positioned box=]
824
875
can use the <dfn>anchor()</dfn> function
@@ -989,57 +1040,26 @@ of the [=box fragment|fragments=]' [=border boxes=] is used instead.
989
1040
which input is being referred to.
990
1041
</div>
991
1042
1043
+ <h4 id=anchor-resolution oldids=anchor-valid>
1044
+ Resolution of ''anchor()''</h4>
992
1045
993
- <!-- Big Text: a-center
994
-
995
- ███▌ ███▌ █████▌ █ █▌ █████▌ █████▌ ████▌
996
- ▐█ ▐█ █▌ █▌ █▌ █▌ █▌ █▌ █▌ █▌ █▌
997
- █▌ █▌ █▌ █▌ ██▌ █▌ █▌ █▌ █▌ █▌
998
- █▌ █▌ ████▌ █▌ ████ █▌▐█ █▌ █▌ ████ ████▌
999
- █████▌ █▌ █▌ █▌ ██▌ █▌ █▌ █▌▐█
1000
- █▌ █▌ █▌ █▌ █▌ █▌ █▌ █▌ █▌ █▌ ▐█
1001
- █▌ █▌ ███▌ █████▌ █▌ ▐▌ █▌ █████▌ █▌ █▌
1002
- -->
1003
-
1004
- Centering on the Anchor: the ''anchor-center'' value {#anchor-center}
1005
- ------------------------------------------------------------------------
1006
-
1007
- <pre class=propdef>
1008
- Name : justify-self, align-self, justify-items, align-items
1009
- New Values : anchor-center
1010
- </pre>
1011
-
1012
- The [=self-alignment properties=] allow an [=absolutely positioned box=]
1013
- to align itself within the [=inset-modified containing block=] .
1014
- The existing values,
1015
- plus carefully chosen [=inset properties=] ,
1016
- are usually enough for useful alignment,
1017
- but a common case for anchored positioning--
1018
- centering over the [=anchor box=] --
1019
- requires careful and somewhat complex set-up to achieve.
1020
-
1021
- The new <dfn value for="justify-self, align-self, justify-items, align-items">anchor-center</dfn> value
1022
- makes this case extremely simple:
1023
- if the positioned box has a [=default anchor box=] ,
1024
- then it is centered (insofar as possible)
1025
- over the [=default anchor box=]
1026
- in the relevant axis.
1027
-
1028
- Additionally,
1029
- any ''top/auto'' [=inset properties=] resolve to ''0'' .
1030
-
1031
- If the box is not [=absolutely positioned=] ,
1032
- or does not have a [=default anchor box=] ,
1033
- this value behaves as ''<self-position>/center''
1034
- and has no additional effect on how [=inset properties=] resolve.
1046
+ An ''anchor()'' function is a
1047
+ <dfn lt="resolvable anchor function|unresolvable anchor function">resolvable anchor function</dfn>
1048
+ only if all the following conditions are true:
1035
1049
1036
- Note: When using ''anchor-center'' , by default
1037
- if the anchor is too close to the edge of the box's
1038
- [=original containing block=] ,
1039
- it will “shift” from being purely centered,
1040
- in order to remain within the [=original containing block=] .
1041
- See [[css-align-3#overflow-values]] for more details.
1050
+ * It's applied to an [=absolutely positioned box=] .
1051
+ * If its <<anchor-side>> specifies a physical keyword,
1052
+ it's specified in an [=inset property=] applicable to that axis.
1053
+ (For example, ''anchor()/left'' can only be used in 'left' , 'right' ,
1054
+ or a logical [=inset property=] in the horizontal axis.)
1055
+ * There is a [=target anchor element=]
1056
+ for the box it's used on,
1057
+ and the <<anchor-name>> value specified in the function.
1042
1058
1059
+ If any of these conditions are false,
1060
+ the ''anchor()'' function [=computed value|computes=] to its specified fallback value.
1061
+ If no fallback value is specified,
1062
+ it makes the declaration referencing it [=invalid at computed-value time=] .
1043
1063
1044
1064
<!-- Big Text: scroll
1045
1065
@@ -1260,27 +1280,6 @@ specifically, the [=default anchor element=]:
1260
1280
</div>
1261
1281
1262
1282
1263
- Resolution of ''anchor()'' {#anchor-valid}
1264
- --------------------------
1265
-
1266
- An ''anchor()'' function is a
1267
- <dfn lt="resolvable anchor function|unresolvable anchor function">resolvable anchor function</dfn>
1268
- only if all the following conditions are true:
1269
-
1270
- * It's applied to an [=absolutely positioned box=] .
1271
- * If its <<anchor-side>> specifies a physical keyword,
1272
- it's specified in an [=inset property=] applicable to that axis.
1273
- (For example, ''anchor()/left'' can only be used in 'left' , 'right' ,
1274
- or a logical [=inset property=] in the horizontal axis.)
1275
- * There is a [=target anchor element=]
1276
- for the box it's used on,
1277
- and the <<anchor-name>> value specified in the function.
1278
-
1279
- If any of these conditions are false,
1280
- the ''anchor()'' function [=computed value|computes=] to its specified fallback value.
1281
- If no fallback value is specified,
1282
- it makes the declaration referencing it [=invalid at computed-value time=] .
1283
-
1284
1283
<!-- Big Text: visibility
1285
1284
1286
1285
█▌ █▌ ████ ███▌ ████ ████▌ ████ █▌ ████ █████▌ █ ▐▌
@@ -1460,8 +1459,9 @@ to the <<length>> separating the relevant border edges
1460
1459
whichever is in the specified axis)
1461
1460
of the [=target anchor element=] .
1462
1461
1463
- Resolution of anchor-size() {#anchor-size-valid}
1464
- ---------------------------
1462
+
1463
+ <h4 id=anchor-resolution oldids=anchor-valid>
1464
+ Resolution of ''anchor-size()''</h4>
1465
1465
1466
1466
An ''anchor-size()'' function is a
1467
1467
<dfn lt="resolvable anchor-size function|unresolvable anchor-size function">resolvable anchor-size function</dfn>
0 commit comments