Rules Hub
Code Ruleset
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
Show scroll affordances only when content actually overflows
Don't leave a permanent border/shadow indicating scroll. Detect overflow (scroll event + state, or CSS) and show the shadow/border only while the content overflows.
Bad example
| 1 | <th className="border-r border-gray-75"> {/* always shown, even when not scrolling */} |
Explanation (EN)
A permanent scroll shadow can imply hidden content when everything is already visible.
Objašnjenje (HR)
Good example
| 1 | const isScrolling = useHorizontalScrollCheck(ref); |
| 2 | <th className={clsx(isScrolling && 'border-r border-gray-75')}> |
Explanation (EN)
Objašnjenje (HR)
Notes (EN)
Show scroll continuation indicators from actual overflow and edge position, updating when content or container dimensions change as well as when scrolling occurs.
Exceptions / Tradeoffs (EN)
A permanent separator may be a design boundary rather than an overflow hint. A flag named isScrolling does not by itself prove overflow or hidden content.