v1.3.1
  1. Foundations
  2. How-tos
  3. Patterns
    1. Autocomplete
    2. Button
    3. Callout
    4. Chat
    5. Description List
    6. Fallback Image
    7. Feedback
    8. Focus Indicator
    9. Footer
    10. Header
    11. Hero
    12. IIIF Image
    13. Link
    14. Page Title
    15. Results per Page

Focus Indicator

Create clear focus styles that guide users through your interface.

Help users identify interactive elements.

When to use

Apply focus styles to every interactive element such as buttons, links, and form controls so users can navigate confidently.

How to use

Create two contrasting borders by applying box-shadow and removing the browser default outline. This approach ensures your focus style meets contrast requirements independently.

Example

*:focus {
  box-shadow: var(--pl-focus-box-shadow);
}

/* Or modify for your situation */
*:focus {
  box-shadow: 0 0 0 2px var(--pl-color-bg-accent), 0 0 0 4px var(--pl-color-fg-default);
  outline: none;
}

Relevant guidelines

Design System

About Writing for People Build Digital Spaces v1.3.1