โ† Web Performance (Core Web Vitals) learning path
Web Performance (Core Web Vitals) ยท Module 5 of 8

CSS, fonts and rendering

Get the first screen painted fast.

๐Ÿ“– Key ideas

  1. CSS in the head blocks rendering until it loads, so keep the first-screen CSS small.
  2. Inline critical CSS for above-the-fold content and load the rest normally.
  3. Web fonts can hide text while loading; font-display: swap shows fallback text first.
  4. Limit font families and weights, and subset fonts to the characters you need.
  5. Avoid animating layout properties such as width or top; animate transform and opacity instead.
๐Ÿ’ก Real-life example: Rendering a page is like setting up a stage: if the curtain stays shut until every costume arrives, the audience waits; show the actors first and bring props after.
Render-blockingA resource the browser must load before showing the page
Critical CSSMinimal styles needed for the first screen
font-display: swapShow fallback text until the web font loads
SubsettingKeeping only needed characters in a font file