Rules Hub
Code Ruleset
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
When visually hiding an interactive element, also block interaction
Match hidden visuals with the intended focus, pointer and accessibility state; opacity alone does not remove a control.
Bad example
| 1 | .clearButton { opacity: 0; } /* still clickable, still read by SR */ |
Explanation (EN)
A transparent control can remain interactive and announced even when the user cannot see it.
Objašnjenje (HR)
Good example
| 1 | .clearButton { opacity: 0; pointer-events: none; visibility: hidden; } |
Explanation (EN)
Objašnjenje (HR)
Notes (EN)
For a control intended to be absent from interaction and accessibility, use the appropriate hidden/unmounted/inert state and verify focus behavior during any opacity transition.
Exceptions / Tradeoffs (EN)
Opacity alone preserves hit testing and accessibility. pointer-events:none alone does not remove keyboard focus, and descendants can override inherited visibility. Visually hidden accessible labels are a different use case.