You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: css-shapes-1/Overview.bs
+29-57Lines changed: 29 additions & 57 deletions
Original file line number
Diff line number
Diff line change
@@ -602,75 +602,47 @@ Serialization of Basic Shapes</h3>
602
602
To serialize the <<basic-shape>> functions,
603
603
serialize as per their individual grammars,
604
604
in the order the grammars are written in,
605
-
avoiding calc() expressions where possible,
606
-
avoiding calc() transformations,
607
-
omitting components when possible without changing the meaning,
608
605
joining space-separated tokens with a single space,
609
606
and following each serialized comma with a single space.
607
+
For serializing [=computed values=],
608
+
component values are [=computed value|computed=],
609
+
and omitted when possible without changing the meaning.
610
610
611
-
<div class="example">
612
611
613
-
Since <<position>> keywords stand in for percentages, keywords without an offset turn into percentages.
614
-
615
-
<pre><code>
616
-
circle(at left bottom)
617
-
618
-
serializes as "circle(at 0% 100%)"
619
-
</code></pre>
620
-
621
-
Omitting components means that some default values do not show up in the serialization. But since <<position>> always uses the 2- or 4-value form, a default <<position>> is not omitted.
622
-
623
-
<pre><code>
624
-
circle(closest-side at center)
625
-
626
-
serializes as "circle(at 50% 50%)"
627
-
</code></pre>
628
-
629
-
Using grammar order means that <<position>> values always give horizontal components first, then vertical.
630
-
631
-
<pre><code>
632
-
circle(at bottom left)
633
-
634
-
serializes as "circle(at 0% 100%)"
635
-
</code></pre>
636
-
637
-
Avoiding calc() expressions means that some <<position>> values that could be simplified to the 2-value form must be serialized in 4-value form instead.
638
-
639
-
<pre><code>
640
-
circle(at right 5px bottom 10px)
641
-
642
-
serializes as "circle(at right 5px bottom 10px)"
643
-
644
-
not as "circle(at calc(100% - 5px) calc(100% - 10px))"
645
-
</code></pre>
646
-
647
-
Avoiding calc() transformations means that if a specified (or computed) calc() must stay in calc() form, it will be used as-is, not reformulated with a different origin or reduced.
648
-
649
-
<pre><code>
650
-
bottom calc(10% + 5px)
651
-
652
-
serializes as "bottom calc(10% + 5px)"
612
+
<div class="example">
653
613
654
-
not as "top calc(90% - 5px)" or "calc(90% - 5px)"
655
-
</code></pre>
614
+
As [=specified value=] serialization of the shape functions are relatively trivial,
615
+
here are some examples of [=computed value=] serializations:
656
616
657
-
Preferring 0% over a zero length comes up when you must supply an omitted offset.
617
+
* <<position>>[[css-values-4#position-serialization|serialization rules]] mean that
0 commit comments