Tailwind is mobile-first. Start with mobile styles, then add breakpoint prefixes to override for larger screens. This lesson covers the breakpoint system and common responsive patterns.
Add a breakpoint prefix before any utility to apply it at that screen size and above. No breakpoint = applies to all sizes (mobile first).
sm: 640px+
md: 768px+
lg: 1024px+
xl: 1280px+
2xl: 1536px+
Main content
Sidebar
Big Heading
Card
md: or lg: to adjust for larger screens. Adding breakpoints to 'undo' mobile styles is a sign you started desktop-first.
Card Title
Description text here.
lg: screens.overflow-x-auto).sm: = 640px+, md: = 768px+.md:/lg: to scale up.hidden md:flex = hidden on mobile, flex on desktop. flex md:hidden = opposite.grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 — responsive grid in one line.