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 ruleP1universalStack: css
layoutresponsivegridvisibility
Toggle responsive visibility on the layout container, not just the inner element
Hiding only a child element while its grid/flex container remains can break the layout; apply the show/hide class to the cell/container so spacing stays correct.
PR: frontpage-web · org-mining-hist-2026-06Created: Jun 18, 2026
Bad example
Old codejsx
| 1 | <div className='cell'> |
| 2 | <a className={isHidden ? 'show-for-medium' : ''}>Link</a> |
| 3 | </div> // empty cell still occupies the grid |
Explanation (EN)
Objašnjenje (HR)
Good example
New codejsx
| 1 | <div className={`cell ${isHidden ? 'show-for-medium' : ''}`}> |
| 2 | <a>Link</a> |
| 3 | </div> |
Explanation (EN)
Objašnjenje (HR)