@@ -3142,14 +3142,60 @@ The serialization of the declared value of a relative color is:
3142
3142
3143
3143
3144
3144
<div class="example" id="ex-serial-rcs-specified-simple">
3145
- For example, the result of serializing the declared value
3145
+ For example, the serialization of the declared value of
3146
3146
3147
3147
<pre class="lang-css"> OkLcH(from peru l c h)</pre>
3148
3148
3149
3149
is the string "oklch(from peru l c h)"
3150
3150
</div>
3151
3151
3152
- <!-- need a more complex example, and one with calc too -->
3152
+ <div class="example" id="ex-serial-rcs-calc">
3153
+ For example, the serialization of the declared value of
3154
+
3155
+ <pre class="lang-css"> rgb(from red calc(r / 2) g calc(30%));</pre>
3156
+
3157
+ is the string "rgb(from red calc(0.5 * r) g calc(30%))",
3158
+ while the serialization of the computed value
3159
+ is the string "color(srgb 0.5 0 0.3)".
3160
+ </div>
3161
+
3162
+ <div class="example" id="ex-serial-rcs-nested-none">
3163
+ For example, the serialization of the declared value of
3164
+
3165
+ <pre class="lang-css"> hsl(from hsl(none 10% 50%) h s l);</pre>
3166
+
3167
+ is the string "hsl(from hsl(none 10% 50%) h s l)",
3168
+ while the serialization of the computed value
3169
+ is the string "color(srgb 0.55 0.45 0.45)".
3170
+ </div>
3171
+
3172
+ <div class="example" id="ex-serial-rcs-hsl-unclamped">
3173
+ For example, the serialization of the declared value of
3174
+
3175
+ <pre class="lang-css"> hsl(from hsl(127.9 302% 25.33%) h s l);</pre>
3176
+
3177
+ is the string "hsl(from hsl(127.9 302% 25.33%) h s l)",
3178
+ while the serialization of the computed value
3179
+ is the string "color(srgb -0.511666 1.018266 -0.310225)".
3180
+ </div>
3181
+
3182
+ <div class="example" id="ex-serial-rcs-currentcolor">
3183
+ Given the following HTML (note the color property set on this element):
3184
+
3185
+ <pre class="lang-html">
3186
+ <div id="example"
3187
+ style="background-color: rgb(from currentcolor r g calc(b / 2));
3188
+ color: blue;">
3189
+ </div>
3190
+ </pre>
3191
+
3192
+ The serialization of the declared value of ''background-color''
3193
+ is the string "rgb(from currentcolor r g calc(b / 2))"
3194
+ while the serialization of the computed value
3195
+ is the string "color(srgb 0 0 0.5)"
3196
+
3197
+ </div>
3198
+
3153
3199
3154
3200
The serialization of the result of a relative color function
3155
3201
depends on whether the keyword ''currentColor'' is the [=origin color=] .
0 commit comments