v1.1.0
  1. Foundations
  2. How-tos
  3. Patterns
    1. Autocomplete
    2. Description list
    3. Chat
    4. Fallback image
    5. Focus indicator
    6. Footer
    7. Header
    8. Hero
    9. IIIF Image
    10. 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 users Build digital spaces v1.1.0