Your development workspace
This app is private. Sign in with your authorized Google account.
When a navigation action becomes unavailable, remove its link behavior and active hover affordance and apply the established disabled appearance from the same state.
| 1 | function ResourceAction({ href }: { href?: string }) { |
| 2 | return href |
| 3 | ? <a href={href} className="action">Open</a> |
| 4 | : <div aria-disabled="true" className="action">Open</div>; |
| 5 | } |
| 6 | // .action:hover { background: navy; } |
Explanation (EN)
The unavailable action keeps the same active appearance and hover feedback as a link.
Objašnjenje (HR)
Nedostupna radnja izgleda aktivno i zadržava hover efekt.
| 1 | function ResourceAction({ href }: { href?: string }) { |
| 2 | return href |
| 3 | ? <a href={href} className="action">Open</a> |
| 4 | : <div aria-disabled="true" className="action">Open</div>; |
| 5 | } |
| 6 | // .action[aria-disabled="true"] { opacity: .5; pointer-events: none; } |
Explanation (EN)
The existing disabled state also controls appearance and pointer feedback. The active link stays unchanged.
Objašnjenje (HR)
Postojeće nedostupno stanje upravlja izgledom i pokazivačem, a aktivni link ostaje isti.
Apply when a formerly actionable link is intentionally rendered without a destination. Derive visual styling from the same availability state. Preserve active-state styling and use the project disabled design rather than inventing a new one.
Apply when a formerly actionable link is intentionally rendered without a destination. Derive visual styling from the same availability state. Preserve active-state styling and use the project disabled design rather than inventing a new one.
An explicit design requirement may intentionally preserve appearance. Do not rely on CSS alone to disable a real link or action. Native disabled buttons should keep their native semantics.
An explicit design requirement may intentionally preserve appearance. Do not rely on CSS alone to disable a real link or action. Native disabled buttons should keep their native semantics.
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).