v1.4.0
  1. Home
  2. Get started
  3. Foundations
  4. Patterns
    1. Accordion
    2. Autocomplete
    3. Button
    4. Callout
    5. Chat
    6. Description List
    7. Details
    8. Expand Text
    9. Fallback Image
    10. Feedback
    11. Focus Indicator
    12. Footer
    13. Header
    14. Hero
    15. IIIF Image
    16. Link
    17. Page Title
    18. Results per Page
    19. Service Switcher
  5. What's new

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

Get started Content & writing v1.4.0