Rules Hub
Code Ruleset
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
Prefer overflow: auto over overflow: scroll
Use overflow: auto so scrollbars only appear when needed; overflow: scroll has caused issues (e.g. trackpad/mouse connect-disconnect) and shows scrollbars unconditionally.
Bad example
| 1 | .list { |
| 2 | overflow: scroll; |
| 3 | } |
Explanation (EN)
An unnecessary scroll container or forced track can add visual clutter in this project's layout.
Objašnjenje (HR)
Good example
| 1 | .list { |
| 2 | overflow: auto; |
| 3 | } |
Explanation (EN)
Objašnjenje (HR)
Notes (EN)
For a region whose scrollbar should appear only when content overflows, prefer auto and test the actual input devices and supported OS scrollbar mode.
Exceptions / Tradeoffs (EN)
scroll can intentionally reserve a scrollbar track; scrollbar-gutter may address layout stability. Overlay scrollbars do not necessarily remain visibly drawn even with scroll.