Responsive design with media queries and mobile-first approach

2825
0

Media queries adapt layouts to different screen sizes using @media rules with breakpoints. I use mobile-first approach starting with base mobile styles and progressively enhancing with min-width queries. Common breakpoints are 640px (sm), 768px (md), 1024px (lg), and 1280px (xl). The orientation feature detects portrait vs landscape mode. Using prefers-color-scheme detects dark mode preference. The prefers-reduced-motion respects accessibility preferences for animations. Viewport units (vw, vh, vmin, vmax) create fluid layouts. Container queries with @container enable component-based responsive design. The clamp() function creates fluid typography that scales between minimum and maximum values.