Skip to content

Commit e79ce9d

Browse files
committedJun 25, 2021
minor fixes
1 parent e06bc63 commit e79ce9d

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed
 

‎7-animation/2-css-animations/article.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -419,14 +419,12 @@ In more technical details, when there's a style change, the browser goes through
419419
2. **Paint**: re-compute how everything should look like at their places, including background, colors,
420420
3. **Composite**: render the final results into pixels on screen, apply CSS transforms if they exist.
421421

422-
During a CSS animation, this process repeats every frame. However, CSS properties that never affect geometry or position, such as `color`, may skip the Layout step. If a `color` changes, the browser doesn't calculate any new geometry, it goes to Paint -> Composite. And there are few properties that directly go to Composite.
422+
During a CSS animation, this process repeats every frame. However, CSS properties that never affect geometry or position, such as `color`, may skip the Layout step. If a `color` changes, the browser doesn't calculate any new geometry, it goes to Paint -> Composite. And there are few properties that directly go to Composite. You can find a longer list of CSS properties and which stages they trigger at https://csstriggers.com.
423423

424424
The calculations may take time, especially on pages with many elements and a complex layout. And the delays are actually visible on most devices, leading to "jittery", less fluid animations.
425425

426426
The animations of properties that skip the Layout step are faster. It's even better if Paint is skipped too.
427427

428-
For most CSS properties, the rule is simple: if its change may affect geometry, move elements (even in theory), then it triggers Layout. Otherwise (e.g. a `color` change may not shift elements around), the browser doesn't need to calculate geometry and directly goes to Paint, or even Composite step. You can find a longer list of CSS properties and which stages they trigger at <https://csstriggers.com>.
429-
430428
The `transform` property is a notable exception:
431429
- CSS transforms affect the target element box as a whole (rotate, flip, stretch, shift it).
432430
- CSS transforms never affect neighbour elements.

0 commit comments

Comments
 (0)
Failed to load comments.