โ Web Performance (Core Web Vitals) learning pathWeb Performance (Core Web Vitals) ยท Module 5 of 8
CSS, fonts and rendering
Get the first screen painted fast.
๐ Key ideas
- CSS in the head blocks rendering until it loads, so keep the first-screen CSS small.
- Inline critical CSS for above-the-fold content and load the rest normally.
- Web fonts can hide text while loading; font-display: swap shows fallback text first.
- Limit font families and weights, and subset fonts to the characters you need.
- 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