CSS Environment Variables, Safe Areas, and Viewport Segments Cheat Sheet
Build edge-to-edge interfaces that avoid display cutouts, virtual keyboards, desktop window controls, and foldable-device hinges with CSS env().
Open cheat sheetCSS · 9 guides
Adapt interfaces for viewports, scrolling, controls, printing, and component boundaries.
Focused references
Each guide includes copy-ready syntax, detailed examples, and authoritative references.
Build edge-to-edge interfaces that avoid display cutouts, virtual keyboards, desktop window controls, and foldable-device hinges with CSS env().
Open cheat sheetStyle selections, spelling and search highlights, and arbitrary DOM ranges with the Custom Highlight API while preserving contrast and semantics.
Open cheat sheetAdapt CSS to viewport ranges, orientation, input capabilities, print, display density, color schemes, contrast, forced colors, and reduced-motion preferences.
Open cheat sheetControl CSS overflow, clipping, scroll containers, text truncation, scrollbar stability, overscroll, anchoring, and user resizing accessibly.
Open cheat sheetCreate readable printed and PDF output with print media queries, page size and margins, fragmentation controls, running content, link expansion, and ink-aware fallbacks.
Open cheat sheetBuild locally scoped styles and intentional Web Component theme APIs with @scope, :scope, :host, ::slotted(), ::part(), exportparts, fallbacks, and accessibility safeguards.
Open cheat sheetStyle scrollbar colors and thickness without breaking scrolling, contrast, forced colors, keyboard access, touch input, or platform conventions.
Open cheat sheetBuild usable scroll containers with overflow, scroll padding and margin, snap points, smooth behavior, overscroll control, scrollbars, and anchored targets.
Open cheat sheetStyle native controls and interaction feedback with accent-color, appearance, focus outlines, caret and cursor choices, resizing, selection, hit testing, and forced-color support.
Open cheat sheet