Responsive Design Articles
Understanding CSS Breakpoints
Breakpoints are the points at which a design adapts to provide the best possible layout for the user. The 1024px breakpoint is commonly used to distinguish between tablet and desktop layouts. The HEA side panel uses this breakpoint to decide when to auto-collapse.
Published: June 29, 2026 β Responsive Design
Window Resize Events and Performance
The window resize event fires rapidly during manual resizing. Handlers should use debouncing or requestAnimationFrame to avoid layout thrashing. The side panel widget debounces its resize handler to prevent excessive DOM mutations during resize.
Published: June 28, 2026 β Performance
Preserving State Across Layout Changes
When a widget auto-collapses due to viewport changes, it should preserve its internal state β conversation history, scroll position, and user input. Re-expanding should restore the exact same state the user left off at, not reload from scratch.
Published: June 27, 2026 β UX Patterns
Body Margin Management in Sidebars
Side panels that push body content need careful margin management. When opening, the panel adds a margin to the body. When closing or auto-collapsing, this margin must be removed cleanly. Edge cases include animations during rapid resize and multiple margin sources.
Published: June 26, 2026 β Layout Engineering
Testing Responsive Layouts
Manual testing of responsive layouts requires systematically resizing the browser window while observing layout changes. Automated testing can use tools like Playwright's setViewportSize to programmatically verify breakpoint behavior.
Published: June 25, 2026 β Testing
Container Queries vs Media Queries
While media queries respond to viewport size, container queries respond to parent element size. For embedded widgets, container queries can be more appropriate since the widget's available space depends on the host layout, not just viewport width.
Published: June 24, 2026 β Modern CSS
Mobile-First vs Desktop-First
Mobile-first design starts with the smallest screen and adds complexity for larger screens. Desktop-first starts with the full experience and simplifies for mobile. The side panel's breakpoint behavior is desktop-first: it collapses features below the breakpoint.
Published: June 23, 2026 β Design Strategy