Solice UI
Back to the curriculum

Chapter 6 · Performance & Tooling

Rendering and reflow

When a page changes, the browser may need to recalculate styles, layout boxes, and painted pixels. You do not need to memorize the rendering engine to avoid the most common unnecessary work.

Beginner · Lesson 1 of 6 in this chapter

Different changes cost different work

Changing text or dimensions can affect layout around an element. Changing only a color usually needs paint but not new geometry. Transform and opacity changes can often be composed efficiently on their own layer.

Stable space prevents visible jumps

Images, ads, and async content should reserve the space they will occupy. Repeatedly reading layout and writing styles inside one loop can also force the browser to stop and recalculate more often than needed.

Loading a hero image

  1. The image element declares its intrinsic width and height.
  2. The layout reserves the correct aspect ratio before the file arrives.
  3. When the image loads, nearby text stays in place instead of jumping downward.
  • Layout changes can affect surrounding elements.
  • Reserve space for content that loads later.
  • Measure real behavior before attempting tiny rendering optimizations.