Skip to content

Make all focus rings consistent #15139

Open

Description

@cwickham

The problem

Keyboard focus in Quarto 1.11.6, in Chromium, WebKit, and Chromium forced-colors mode, grouped by indicator type. The body link has the browser ring. The sidebar section toggle has a gray 2px outline. The navbar item, 'On this page' link, and tab have a faint light-blue halo. The search input has a thin light-blue border. In forced-colors mode, the body link and sidebar toggle keep a ring, the navbar item, 'On this page' link, and tab have no indicator, and the search input shows only its normal border.

Quarto's HTML output has no single definition of keyboard focus. Controls use four different indicators:

The two box-shadow indicators also lack contrast. They fail the 3:1 minimum of WCAG 1.4.11 in every case I measured:

Control Background Contrast
Navbar item, default theme navbar #517699 1.01:1
"On this page" link, tab, listing controls page #ffffff 1.41:1
Search input page #ffffff 2.42:1

Forced-colors mode removes box-shadow, so these controls then have no focus indicator at all (WCAG 2.4.7).

Proposal: one focus ring

I think Quarto should use one focus ring for every focusable element, defined in one place.

The first step is to turn off Bootstrap's halos at the source, with Sass defaults:

/*-- scss:defaults --*/
$focus-ring-box-shadow: none;
$form-select-focus-box-shadow: none;
$btn-focus-width: 0;

Then one global :focus-visible rule can replace Quarto's per-control focus rules: the sidebar toggle rule, the #14785 outline: revert, and the outline: none rules in quarto-search.scss.

What the ring looks like is still open. For example, it can be the browser's own ring, or a ring that Quarto defines with good contrast in every theme. I will investigate the options in the PR.

I measured the indicators above on renders from Quarto 1.11.6, in Chromium 151 and WebKit 26.5 (Playwright 1.62). AI tools helped with this investigation, grounded in a local clone of quarto-cli at v1.11.6.

Activity

  1. self-assigned this
    on Oct 21, 2026
  2. added
    themesRelated to HTML theming or any other style related issue (like highlight-style)
    htmlIssues with HTML and related web technology (html/css/scss/js)
    on Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

accessibilityhtmlIssues with HTML and related web technology (html/css/scss/js)themesRelated to HTML theming or any other style related issue (like highlight-style)

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions