Grandma Marni’s two price boards with the same CSS, one short list and one long: set overflow-y and scrollbar-gutter, then the browser measures the…
Why it matters
A page or panel that "jumps" sideways when the scrollbar appears is a layout shift: text rewraps, buttons move, and it feels cheap, especially between pages. One line of CSS removes it, without guessing each OS’s scrollbar width.
The key idea
A classic scrollbar takes its width from the content
Common mistakes
Guessing the scrollbar width with a manual padding-right The scrollbar width differs per OS, setting and zoom (0 for overlay, 15–17px for classic). scrollbar-gutter: stable lets the browser reserve the right size.
scrollbar-gutter seems to do nothing on a Mac macOS defaults to overlay scrollbars that take no room, so there is no jump and nothing to reserve. Windows/Linux users, and Macs set to "Show scroll bars: Always", still get it. Keep it on.
scrollbar-gutter is set but no gutter shows It only applies to scroll containers: overflowauto, scroll or hidden. With visible (the default) it is ignored.
Try it in this playground
Leave the gutter on auto, see the jump Edit the list a little: the noon board’s writing is narrower by the scrollbar width, and its lines rewrap.
Set scrollbar-gutter: stable The morning board now has an empty gutter (hatched), and both writing widths match.
Try stable both-edges A gutter appears on the left too; the writing’s centre is back in the middle of the board.
Set overflow-y: visible with a stable gutter The gutter is gone: the board is no longer a scroll container, so scrollbar-gutter is ignored.