โ† Next.js learning path
Next.js ยท Module 6 of 10

Styling and images

Style with CSS Modules or Tailwind, and optimise images and fonts.

๐Ÿ“– Key ideas

  1. Global CSS imported in the root layout.
  2. CSS Modules (Button.module.css) scope styles to a component.
  3. Tailwind CSS is supported out of the box.
  4. next/image resizes, lazy-loads and serves modern formats.
  5. next/font loads fonts with no layout shift.
๐Ÿ’ก Real-life example: next/image is a smart photo printer: it prints the right size for every screen.
CSS ModulesLocally scoped CSS files
next/imageOptimised image component
next/fontOptimised font loading
CLSCumulative Layout Shift