Skip to content

Epic: audit interactive components' :focus styles for compatibility across supported browsers #3345

Closed
@caripizza

Description

@caripizza

Background

We currently support the last 2 versions of Chrome, Firefox, Safari, and Edge. We should ensure focus outlines appear consistently across these browsers in our interactive components.

Per Figma > Calcite Components > _Master Styles, here are the "Focus State Rules":

Rule 1. First choice:

/* Use `focus-inset` TW utility which amounts to: */
.focus-inset {
  outline: 2px solid var(--calcite-ui-brand);
  outline-offset: -2px;
}

Rule 2. Second choice (when first choice isn't possible):

/* Use `focus-outset` TW utility which amounts to: */
.focus-outset {
  outline: 2px solid var(--calcite-ui-brand);
  outline-offset: 2px;
}

image

Desired Outcome

  1. Interactive components (should) use the focus-base TW utility to add an initial transparent outline color when not in focus. It currently includes a CSS transition. Explore removing this transition completely to make our components load perceptibly faster:
/* (Also appears as `focus-style-base` mixin in some components) */
.focus-base {
  outline-offset: 0;
  outline-color: transparent;
  transition: outline-offset 100ms ease-in-out, outline-color 100ms ease-in-out; // REMOVE ME
}
  1. For each focusable component, audit its focus styles. Make a list of each component and which rule (1 or 2 above) it utilizes for its focus.

  2. Resolve inconsistencies between similar components' focus states (ie., across button components)

  3. Ensure all fine-tuned focus outlines appear across supported browsers.

  4. Edit (or remove) the readme focus content which we include in cc global styles: https://github.com/Esri/calcite-components/blob/master/src/assets/styles/readme.md#focus-states

Metadata

Metadata

Assignees

No one assigned

    Labels

    0 - newNew issues that need assignment.epicLarge scale issues to be broken up into sub-issues and tracked via sprints and/or project.needs triagePlanning workflow - pending design/dev review.researchIssues that require more in-depth research or multiple team members to resolve or make decision.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions