Module 07 of 10

Styling & Optimization

Lessons

About This Module

Next.js supports several ways to style an app: global CSS, CSS Modules for locally scoped class names, inline styles, and utility-first frameworks like Tailwind CSS. This module starts with the styling options and then walks through setting up Tailwind in a Next.js project.

The second half is about optimization. next/font self-hosts your Google or local fonts so there are no extra network requests and less layout shift, and next/image serves correctly sized, lazy-loaded images. Some of the font videos were recorded for earlier Next.js versions (the package was called @next/font then), but the ideas carry over directly.

Watch the lessons in order, then continue on to Route Handlers & Databases.

Lessons

4 videos
01

Styling Next.js Applications

Shows how to style a Next.js app with CSS Modules, inline CSS, global CSS and Tailwind CSS.

02

Getting Started with Tailwind CSS in Next.js

Installs Tailwind in a Next.js project, configures PostCSS, sets up IDE autocomplete, explains Preflight, and refactors components with Tailwind classes.

03

Using Fonts in Next.js (Google Fonts, Local Fonts, Tailwind CSS)

Font optimization with next/font for both local and Google fonts, which are self-hosted automatically, plus how to use them with Tailwind.

04

Mastering Next.js 14: Optimizing Fonts and Images

Covers adding custom fonts with next/font and images with next/image, and how both are optimized.