Rules Hub
Code Ruleset
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
Keep content available to screen readers with sr-only
When hiding text visually on some breakpoints, use sr-only / not-sr-only so the label stays announced rather than removed.
Bad example
| 1 | <span className="hidden md:inline">Download</span> <!-- gone for screen readers on mobile --> |
Explanation (EN)
display:none removes the label from accessibility exposure as well as the screen.
Objašnjenje (HR)
Good example
| 1 | <span className="sr-only md:not-sr-only">Download</span> |
Explanation (EN)
Objašnjenje (HR)
Notes (EN)
When text must remain an accessible name at a visually hidden breakpoint, use the existing visually-hidden utility and test the name in both viewport states.
Exceptions / Tradeoffs (EN)
If the entire control is unavailable, removing its label with it can be correct. Avoid duplicate names when aria-label or another visible label already supplies the same text.