How this tool works
Two different mechanisms are emitted together because neither one is enough on its own. The standard properties, scrollbar-width and scrollbar-color, are the only route Firefox offers, and they are deliberately limited: a keyword for the width and a pair of colours, nothing more. The WebKit pseudo-elements are the only way to set an exact pixel width or a corner radius, and they are what Chrome, Edge and Safari have understood for years.
The rule is scoped to whatever selector you enter, which matters more than it sounds: applied to the whole page a restyled scrollbar affects every reader, while scoped to one panel it affects only the component you meant. The preview drives its pseudo-elements through custom properties, because a pseudo-element cannot be reached from an element's inline style.
Restyling a control people rely on
- A thin scrollbar is a smaller target: the standard thin keyword and a narrow pixel width both shrink the area a person has to hit with a mouse. On a control used for navigation that is a real cost, and it is worth leaving the default width on long pages.
- Contrast between thumb and track is what makes it usable: a thumb that barely differs from its track disappears against the page. The 3:1 non-text minimum is the right target, since the thumb is a control rather than decoration.
- The two syntaxes will not match exactly: Firefox rounds the width to its own idea of thin or auto and ignores the radius entirely, so the same rule looks slightly different across browsers by design rather than by fault.
- Overlay scrollbars ignore most of this: macOS and touch devices hide the scrollbar until it is used and draw it their own way. Treat the styling as an enhancement on pointer devices, not as a layout you can depend on.