Rules Hub
Coding Rules Library
← Back to all rules
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
frontend ruleP2universalStack: CSS / React
uxoverflowscrollresponsive
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.
PR: hegnar-bellsheep-web · org-mining-hist-2026-06Created: Jun 18, 2026
Bad example
Old codetsx
| 1 | <th className="border-r border-gray-75"> {/* always shown, even when not scrolling */} |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetsx
| 1 | const isScrolling = useHorizontalScrollCheck(ref); |
| 2 | <th className={clsx(isScrolling && 'border-r border-gray-75')}> |
Explanation (EN)
Objašnjenje (HR)