Skip to content

Commit 16133fe

Browse files
committed
[css-easing-2][editorial] Add a note about cubic bezier restrictions.
1 parent 49b0701 commit 16133fe

1 file changed

Lines changed: 24 additions & 1 deletion

File tree

css-easing-2/Overview.bs

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ WPT Display: closed
4545
}
4646
</style>
4747
<style>
48-
/* Creates an easing example. Use like <div style="--easing: linear"></div>. */
48+
/* Creates an easing example. Use like <div class=easing-track style="--easing: linear"></div>. */
4949
.easing-track {
5050
position: relative;
5151
height: 1em;
@@ -628,6 +628,29 @@ The meaning of each value is as follows:
628628

629629
Both <var ignore>x</var> values must be in the range [0, 1]
630630
or the definition is invalid.
631+
632+
<details class=note>
633+
<summary>Details on cubic Bézier curves</summary>
634+
635+
Note that this does <em>not</em> use the [=input progress value=] as the "t" value
636+
commonly used to parametrize cubic Bézier curves
637+
(producing a 2d point as the output),
638+
but rather uses it as the "x" value on the graph
639+
(producing a y value as the output).
640+
This means that only the <em>shape</em> of the curve matters,
641+
not the velocity along that curve.
642+
For example, ''cubic-bezier(0, 0, 0, 0)'' and ''cubic-bezier(1, 1, 1, 1)''
643+
produce exactly the same (linear) easing,
644+
despite the first's <em>velocity</em> following a <code>t<sup>3</sup></code> curve,
645+
while the second follows a <code>t<sup>1/3</sup></code> curve.
646+
647+
<em>In general</em>, cubic Bézier curves can have loops:
648+
places where a single x value is associated with multiple y values.
649+
The restriction placed on the control points
650+
(that their x values be in the [0,1] range)
651+
prevent this,
652+
so the resulting easing function is well-defined.
653+
</details>
631654
</dl>
632655

633656
The keyword values listed above are illustrated below.

0 commit comments

Comments
 (0)