Tailwind CSS
Style fast with utility classes: responsive design, dark mode, animations, and custom themes with Tailwind CSS v4.
Introduction & Setup
4 minTailwind CSS is a utility-first CSS framework: instead of writing custom CSS classes, you compose small single-purpose classes like flex, p-4, and text-center directly in your H...
Utility-First Fundamentals
4 minThe utility-first workflow means styling by combining many small classes, each doing one job. It keeps styles next to the markup, removes the need to invent class names, and kee...
Spacing & Sizing
4 minTailwind uses one spacing scale for padding, margin, gap, width, height and more. Learning that scale and a handful of sizing helpers lets you build consistent layouts quickly.
Typography
3 minTailwind gives you utilities for font size, weight, line height, spacing, alignment and decoration, so you can set up a complete type system without writing CSS.
Colors & Backgrounds
3 minTailwind ships with a carefully designed color palette (each color has shades from 50 to 950) and utilities for text, background, border and gradient colors, plus opacity modifi...
Borders, Shadows & Effects
3 minBorders, rounded corners, shadows, rings, blur and opacity add depth and polish to a design. Tailwind exposes all of them as short utilities that can be combined and animated.
Layout & Positioning
3 minBefore reaching for flexbox or grid, you need Tailwind's core layout utilities: display, position, z-index, overflow and visibility. They decide how elements flow, stack and ove...
Flexbox
3 minFlexbox in Tailwind is a handful of intuitive classes that arrange items in a row or column, align them, space them out and let them grow or shrink. It is the go-to tool for nav...
Grid
3 minTailwind's grid utilities let you build two-dimensional layouts with a single line: define columns with grid-cols-*, space them with gap-*, and make items span multiple tracks w...
Responsive Design
3 minTailwind is mobile-first: unprefixed utilities apply to every screen size, and breakpoint prefixes like md: apply from that width and up. This makes responsive design a matter o...
State Variants
3 minVariants are prefixes that apply a utility only in a certain state — hover:, focus:, active:, disabled:, group-hover: and many more. They let you build interactive UI entirely i...
Dark Mode
4 minTailwind's dark: variant applies styles when dark mode is active. By default it follows the operating system preference, and you can switch to a manual toggle (class or data att...
Transitions & Animations
3 minTailwind makes motion easy: transition utilities smooth state changes, transform utilities move, scale and rotate elements, and built-in animate-* classes provide spinners, puls...
Customization with @theme
4 minTailwind v4 is configured in CSS. The @theme directive defines design tokens — colors, fonts, spacing, breakpoints, shadows, animations — as CSS variables, and Tailwind automati...
Reusing Styles & Components
5 minLong class lists are fine when they live in one place. This lesson covers the right ways to avoid repetition in Tailwind: components first, then @apply, @utility and @layer, plu...