@@ -1012,6 +1012,57 @@ Interpolation Mapping Notations: the *-interpolate() family</h2>
1012
1012
* |stop| represents an [=interpolation stop=] ; see [[#interpolation-map-arguments]]
1013
1013
* |between-options| specifies options for the interpolation between the two surrounding stops.
1014
1014
1015
+ <div class=example>
1016
+ For example,
1017
+ the following changes the background color of an element
1018
+ depending on the width of the viewport:
1019
+
1020
+ <pre highlight=css>
1021
+ background: color-interpolate(100vw in lch,
1022
+ 200px: palegoldenrod,
1023
+ 800px: palegreen,
1024
+ 2000px: powderblue
1025
+ );
1026
+ </pre>
1027
+
1028
+ * Below ''200px'' , the color is ''palegoldenrod'' ;
1029
+ * From ''200px'' to ''800px'' ,
1030
+ the color interpolates in ''lch''
1031
+ from ''palegoldenrod'' to ''palegreen'' ;
1032
+ * From ''800px'' to ''2000px'' ,
1033
+ the color interpolate in ''lch''
1034
+ from ''palegreen'' to ''powderblue'' ;
1035
+ * Above ''2000px'' , the color is ''powderblue'' .
1036
+ </div>
1037
+
1038
+ <div class=example>
1039
+ In the following example,
1040
+ the font size interpolates from a smaller size on small screens
1041
+ to a larger size on large screens,
1042
+ easing along the interpolation curve.
1043
+ The author is storing the progress scale in a custom property
1044
+ to be able to re-use it across multiple 'font-size' declarations
1045
+ throughout the document.
1046
+
1047
+ <pre highlight=css>
1048
+ html {
1049
+ --font-scale: progress(100vw, 200px, 2000px) ease-in-out;
1050
+ font-size: calc-interpolate(var(--font-scale),
1051
+ 0%: 16px,
1052
+ 70%: 20px,
1053
+ 100%: 24px);
1054
+ }
1055
+ h1 {
1056
+ font-size: calc-interpolate(var(--font-scale),
1057
+ 0%: 1.2rem,
1058
+ 40%: 2rem,
1059
+ 100%: 3rem);
1060
+ }
1061
+ </pre>
1062
+
1063
+ ISSUE: If anyone has better examples to punch in here let us know...
1064
+ </div>
1065
+
1015
1066
The [=interpolation notations=] in CSS include:
1016
1067
* ''calc-interpolate()'' ,
1017
1068
for interpolating <<number>> , <<length>> , <<percentage>> , <<time>> ,
@@ -1179,6 +1230,7 @@ Defining the Interpolation Map</h4>
1179
1230
When appearing in the first argument,
1180
1231
provides any type-specific interpolation options
1181
1232
that apply to every segment in the [=interpolation map=] .
1233
+ (For example, ''color-interpolate()'' allows <<color-interpolation-method>> .)
1182
1234
When appearing between stops,
1183
1235
provides any type-specific interpolation options
1184
1236
that apply to the interpolation segment between
@@ -1224,9 +1276,9 @@ Calculating the Absolute Interpolation Range</h4>
1224
1276
1225
1277
In an [=absolutely=] typed [=interpolation map=] ,
1226
1278
the first and last [=absolute=] stops in the list
1227
- are pinned to 0% and 100%, respectively.
1279
+ are assigned to 0% and 100%, respectively.
1228
1280
(If there is only one [=absolutely=] typed [=interpolation stop=] ,
1229
- it is pinned to both 0% and 100%.)
1281
+ it is assigned to both 0% and 100%.)
1230
1282
1231
1283
A [=proportionally=] typed [=interpolation map=]
1232
1284
does not define an [=interpolation range=] .
0 commit comments