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
cssaccessibilityinteraction
When visually hiding an interactive element, also block interaction
opacity: 0 alone leaves an element clickable and present for screen readers/SEO; add pointer-events: none and visibility: hidden (or remove from DOM) when truly hiding it.
PR: frontpage-web · org-mining-hist-2026-06Created: Jun 18, 2026
Bad example
Old codecss
| 1 | .clearButton { opacity: 0; } /* still clickable, still read by SR */ |
Explanation (EN)
Objašnjenje (HR)
Good example
New codecss
| 1 | .clearButton { opacity: 0; pointer-events: none; visibility: hidden; } |
Explanation (EN)
Objašnjenje (HR)