CSS Grid Overlap Demo - Online Layered Layout Techniques
Place multiple grid items into the same cells to create overlapping layouts. Learn the technique visually. Copy code.
UD5 Toolkit
Explore how PWA title bar customization works with the Window Controls Overlay API. Visualize safe zones, environment variables, and build immersive app-like experiences.
{
"name": "My PWA App",
"short_name": "PWA",
"start_url": "/",
"display": "standalone",
"display_override": ["window-controls-overlay"],
"theme_color": "#667eea",
"background_color": "#ffffff",
"icons": [
{
"src": "icon-192.png",
"sizes": "192x192",
"type": "image/png"
}
]
}
display_override: ["window-controls-overlay"] enables the feature. Falls back gracefully if unsupported.
/* Detect WCO mode */
@media (display-mode: window-controls-overlay) {
/* Styles specific to WCO mode */
.titlebar {
position: fixed;
left: env(titlebar-area-x, 0);
top: env(titlebar-area-y, 0);
width: env(titlebar-area-width, 100%);
height: env(titlebar-area-height, 40px);
background: #1a1a2e;
color: #fff;
display: flex;
align-items: center;
padding: 0 12px;
}
}
/* Drag region - titlebar background */
.titlebar {
-webkit-app-region: drag;
app-region: drag;
}
/* Interactive elements need no-drag */
.titlebar button,
.titlebar input {
-webkit-app-region: no-drag;
app-region: no-drag;
}
// Check if WCO is available
if ('windowControlsOverlay' in navigator) {
const wco = navigator.windowControlsOverlay;
console.log('WCO visible:', wco.visible);
// Listen for geometry changes
wco.addEventListener('geometrychange', () => {
if (wco.visible) {
console.log('Titlebar area changed!');
// CSS env() variables update automatically
}
});
}
// CSS env variables available in WCO mode:
// env(titlebar-area-x) - X offset of titlebar
// env(titlebar-area-y) - Y offset of titlebar
// env(titlebar-area-width) - Full titlebar width
// env(titlebar-area-height) - Titlebar height
<!-- Titlebar with safe content placement -->
<div class="titlebar">
<div class="titlebar-content">
<span class="app-logo">📱</span>
<span class="app-name">My PWA</span>
</div>
<input type="search" placeholder="Search...">
</div>
display_override: ["window-controls-overlay"] in the web app manifest.
env(titlebar-area-x) — X coordinate of the title bar area (usually 0)env(titlebar-area-y) — Y coordinate of the title bar area (usually 0)env(titlebar-area-width) — Full width of the title barenv(titlebar-area-height) — Height of the title bar (varies by OS: ~29px Windows 10, ~32px Windows 11, ~22-28px macOS)env(titlebar-area-height, 40px).
display_override and use the standard display mode.
-webkit-app-region: drag; — Makes an element draggable (for the titlebar background)-webkit-app-region: no-drag; — Makes interactive elements (buttons, inputs) clickableno-drag set, otherwise clicks won't register. The window control buttons are automatically handled by the OS.
env(titlebar-area-*) variables automatically account for these differences, so using them correctly ensures your content never overlaps the controls regardless of platform. Always test on both operating systems.
navigator.windowControlsOverlay:navigator.windowControlsOverlay.visible — Returns true if WCO is currently activenavigator.windowControlsOverlay.addEventListener('geometrychange', callback) — Fires when the titlebar area changes (e.g., when the user resizes the window or toggles WCO)@media (display-mode: window-controls-overlay) { ... } to apply styles conditionally.
env() variables to avoid overlapping control buttons.env() for when WCO is not active.no-drag.
frame: "none" in Electron or similar) completely removes the native window controls and requires you to re-implement minimize/maximize/close functionality from scratch. Window Controls Overlay is different — it keeps the native window controls but allows you to draw content in the remaining title bar space. This is safer, more accessible, and respects OS conventions while still giving you creative freedom.
Place multiple grid items into the same cells to create overlapping layouts. Learn the technique visually. Copy code.
Control image‑orientation: from-image vs none. See how the browser interprets EXIF rotation. Fix portrait photos.
Learn how to register your PWA to handle custom URL protocols. See the manifest entry and test.
Configure how your PWA launches: focus existing or create new. Test with the launch_handler manifest field.
Register a periodic background sync and see the status. Schedule content updates for your PWA. API demo.
Check if the browser has captured the beforeinstallprompt event. Understand why your PWA is (or isn't) installable.
Check if your site has a service worker registered and if it can load offline. Quick PWA readiness assessment.
Build a horizontal scroll‑snap container with configurable snap‑type and alignment. Perfect for image galleries.
Compare all CSS easing presets side by side on a bouncing ball. See which curve fits your UI animation.
Query the permission state of camera, microphone, geolocation, and more. See the response and learn the API.
Process audio faster than real‑time with OfflineAudioContext. Apply filters and export the result. Dev tool.
Drop files onto a zone and see a preview with name, size, and type. Copy the JavaScript pattern for your site.
Demonstrate how to add custom headers and POST‑like functionality to EventSource using a polyfill. Code and example.
Scroll a container and see how sticky elements behave. Adjust top, bottom, and scroll margins. Copy the code.
See how overflow: visible, hidden, scroll, and auto behave with real content. Clone to test with your text.
See the difference between clone and slice on inline boxes that break across lines. Useful for multi‑line headings.
Render the classic Stanford Bunny with a basic WebGPU pipeline. Rotate and zoom. Check if your browser supports WebGPU.
See how scroll‑padding and scroll‑margin affect the position of elements when using anchor links or scroll‑snap. Visual.
Test the experimental Translation API to translate text between languages directly in the browser, without cloud calls. Check support and copy the JavaScript starter.
Check if your page triggers the beforeinstallprompt event. Simulate the install flow. Debug PWA installability.
Upload a 512x512 logo and get resized icons for every PWA requirement. Download a zip and the corresponding manifest.json snippet.
Apply a convolution filter (blur, sharpen) using a Web Worker. See the UI stay responsive while processing. Learn multithreading in the browser.
Toggle scrollbar‑gutter: stable to reserve space for the scrollbar and avoid content jumps. Visual demo with two columns.
Acquire and release locks across tabs. Prevent race conditions in IndexedDB or localStorage. Visual queue and lock state.
Register a periodic background sync to fetch fresh data even when the tab is closed. Understand the API and limits.
Test the Fullscreen API: request fullscreen on a colored div, detect changes, and copy the JavaScript boilerplate.
See the current state of a Service Worker for your page: installing, waiting, active. Unregister or skip waiting. Developer utility.
See the View Transitions API in action. Cross‑fade and morph between two states. Copy the JavaScript starter code.
Fill in your PWA details to generate a valid manifest.json file. Include icons, theme color, display mode.
Find safe mixing ratios for the classic elephant toothpaste demonstration. Volume adjustments for different container sizes.