CSS Columns Masonry Generator - Online Simple Layout
Build a responsive masonry layout using the column‑count property. No JavaScript. Copy the minimal CSS.
UD5 Toolkit
Instantly compare scrollbar-gutter values and visualize layout shift prevention
Welcome! This panel demonstrates scrollbar-gutter in action.
When content grows and a scrollbar appears, the gutter behavior determines whether your layout shifts.
Item AlphaItem BetaItem Gamma
📏 Current content is short — no scrollbar needed.
Welcome! This panel demonstrates scrollbar-gutter in action.
When content grows and a scrollbar appears, the gutter behavior determines whether your layout shifts.
Item AlphaItem BetaItem Gamma
📏 Current content is short — no scrollbar needed.
scrollbar-gutter in CSS?scrollbar-gutter is a CSS property that controls the space (gutter) reserved for the scrollbar. It was introduced in the CSS Overflow Module Level 3 specification. The property allows developers to stabilize the layout by reserving space for the scrollbar even when it's not visible, preventing unwanted layout shifts when the scrollbar appears or disappears. Supported values include auto (default), stable, and stable both-edges.
scrollbar-gutter: stable prevent layout shift?scrollbar-gutter: stable, the browser always reserves the scrollbar's track space, regardless of whether a scrollbar is actually visible. Without it (using auto), the scrollbar appears and disappears dynamically, changing the available content width by approximately 15–17px on Windows. This sudden width change causes text reflow and element repositioning — a major contributor to Cumulative Layout Shift (CLS), which is a Core Web Vital metric. By reserving the space consistently, stable ensures the layout never shifts.
auto and stable?auto (default): The browser decides when to show the gutter. If no scrollbar is needed, no space is reserved. When a scrollbar appears, it takes up space and shrinks the content area — causing layout shift.stable: The gutter space is always reserved, even if the content is short and no scrollbar is needed. The content width remains constant regardless of scrollbar visibility, eliminating layout shift entirely.stable both-edges do?scrollbar-gutter: stable both-edges reserves gutter space on both the left and right edges of the element. This is particularly useful for symmetrical layouts, bidirectional (LTR/RTL) text support, or designs where visual balance is critical. In a left-to-right context, the left gutter is typically unused, but it ensures the layout remains perfectly centered regardless of scrollbar presence on either side.
scrollbar-gutter has no visible effect in the default macOS configuration. To see the effect, go to System Settings → Appearance → Show scroll bars and select "Always". Windows and most Linux distributions show classic scrollbars that occupy space, making the effect immediately visible.
scrollbar-gutter: stable especially valuable — you don't need to guess or hardcode scrollbar widths.
scrollbar-gutter relate to CLS (Cumulative Layout Shift)?scrollbar-gutter: stable on the <html> or <body> element prevents this, helping achieve a CLS score of 0.
scrollbar-gutter with overflow: hidden?scrollbar-gutter: stable works even with overflow: hidden. The gutter space is reserved regardless of the overflow setting, ensuring that if you dynamically change overflow (e.g., opening a modal that locks body scroll), the layout doesn't shift. This is a common pattern: html { scrollbar-gutter: stable; } combined with body.overflow-hidden when modals are open.
scrollbar-gutter?scrollbar-gutter is supported in all modern browsers:
both-edges may have limited support)auto behavior).
scrollbar-gutter globally to prevent layout shifts?html {
scrollbar-gutter: stable;
}
This ensures the gutter is reserved across all pages. Some developers also apply it to specific scrollable containers (sidebars, modals, etc.) where internal layout stability is critical. Note: if your design uses a fixed header with overflow-y: auto on the body, apply it to the scrolling container instead.
scrollbar-gutter and the old overflow: overlay?overflow: overlay (deprecated, removed from the spec) made scrollbars appear as overlays without taking layout space — the opposite goal of scrollbar-gutter: stable. While overlay prevented layout shifts by never reserving space (always overlaying), it caused content to be hidden behind scrollbars. scrollbar-gutter: stable takes the better approach: always reserving space so content is never obscured and layout never shifts. overflow: overlay should not be used in modern projects.
function getScrollbarWidth() {
const el = document.createElement('div');
el.style.cssText = 'overflow:scroll;visibility:hidden;position:absolute;width:100px;';
document.body.appendChild(el);
const w = el.offsetWidth - el.clientWidth;
el.remove();
return w; // Typically 0 or 15-17
}
This tool automatically runs this detection on page load and displays the result.
Build a responsive masonry layout using the column‑count property. No JavaScript. Copy the minimal CSS.
Compare standard keyboard layouts side-by-side. Click keys to see characters. Useful for learning alternative layouts.
Create multi‑step keyframe animations by adding stops and properties. Play and pause. Copy the complete CSS. Intuitive UI.
Type on your QWERTY keyboard and see the text as if you were on a Dvorak layout. Helps learn Dvorak without switching.
Toggle browser‑generated bold and italic when a real italic is missing. Understand and control font fallback rendering.
Paste a git log and generate a polished changelog grouped by type (feat, fix, etc.). Follows Keep a Changelog format. Local.
Simulate different cache strategies (Cache First, Network First, Stale‑While‑Revalidate) and see responses. Learn offline patterns.
Create half‑hour time blocks for your day. Drag to resize and reorder. Export as image. All local.
Fill in a component name and generate a complete Stencil.js component with TSX, CSS, and test files. Quick start.
Break a large block of text into a numbered list of sentences. Useful for analysis or translation. Local processing.
Acquire and release locks across tabs. Prevent race conditions in IndexedDB or localStorage. Visual queue and lock state.
Build a cron expression using plain English toggles and see its visual timeline. No memorization needed.
Generate a plausible technical blog post title. Useful for practice writing or placeholder content. All local.
Take a normal sentence and reverse the word order. Sound like Yoda or just play with language.
Add a warm, orange light leak to your photo for a vintage film look. Adjust intensity and angle. Instant download.
Start recording and watch for Long Tasks that block the main thread. See task duration and attribution. Improve Interaction to Next Paint.
Fill in daily work hours and tasks, and generate a printable PDF timesheet. Clean, professional layout. Local.
Describe cron schedule expressions in plain English and test future execution times. Indispensable for DevOps and backend developers. Local analysis.
Demonstrate how to yield heavy computation to user input using the isInputPending API. Keep UI responsive.
Paste a corpus of text and generate new random sentences that mimic the style using Markov chains. Local only.
Enter a cron expression and get a plain English description of when it runs. Understand complex schedules instantly. Developer friendly.
Test the Fullscreen API: request fullscreen on a colored div, detect changes, and copy the JavaScript boilerplate.
See the View Transitions API in action. Cross‑fade and morph between two states. Copy the JavaScript starter code.
Visually configure scroll‑snap containers and items. Adjust alignment, stop behavior, and padding. Copy the clean CSS instantly.
Convert hex, RGB, or HSL into the modern OKLCH color space. See the preview and copy CSS oklch() value. Local.
Create complex linear gradients with any number of color stops, exact angles, and length units. Live preview and CSS code.
Design a light and dark theme by picking colors for backgrounds, text, and links. Get the CSS for both themes. Local.
Style underlines, overlines, and strike-throughs with colors, wavy styles, and thickness. Modern CSS text‑decoration.
Adjust opacity visually with a slider and see the different CSS representations (opacity property vs RGBA/HSLA). Copy best option.
Pick two images or colors and apply all 16 CSS mix‑blend‑mode values live. See and copy the right CSS for your design.