When Context Matters
Focus states need to adapt. A navigation menu on a dark background needs a light focus indicator. The same site’s sidebar on a light background needs a dark one. Don’t use the same focus color everywhere.
Modal dialogs are another case. The focus ring needs to stay visible even when the modal has a semi-transparent backdrop. Use a stronger color or thicker outline if needed. Users shouldn’t have to squint to see where they are.
For custom components — dropdowns, carousels, tabs — make sure every interactive element inside has a focus state. It’s easy to forget the next/previous buttons on a carousel or the individual tab options. But keyboard users will try to reach them, and they deserve to know when they’re focused.
The rule is simple: If a mouse user can click it, a keyboard user should be able to see when it’s focused. No exceptions.