a11y: "Other Formats", "Other Links" and "Code Links" in the TOC sidebar are too close together for WCAG 2.5.8

Offen Anfängerfreundlich
#15,401 0 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
79/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
bootstrap, sass

Rechercherichtung

Beginne mit der gemeinsamen Link-Regel in src/resources/formats/html/bootstrap/_bootstrap-rules.scss in den Zeilen 1385–1395 und vergleiche sie dann mit der Bootstrap-Regel für nav-link in src/resources/formats/html/bootstrap/dist/scss/_nav.scss. Überprüfe die gerenderten Größen und Abstände der Sidebar-Links anhand des bereitgestellten Quarto-Beispiels oder mit axe-core. Erledigt ist die Aufgabe, wenn die Ziele Other Formats, Other Links und Code Links die Größen- oder Abstandskriterien von WCAG 2.5.8 erfüllen, ohne die zugehörigen Sidebar-Gruppen zu beeinträchtigen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

accessibility bug
I have:
  • searched the issue tracker for similar issues
  • installed the latest version of Quarto CLI
  • formatted my issue following the Bug Reports guide
Bug description

The links in the "Other Formats", "Other Links" and "Code Links" lists of the TOC sidebar overlap each other.
Each <a> is 24.8px tall, but consecutive links are only 20.4px apart.
axe-core reports target-size (WCAG 2.2 AA, SC 2.5.8) on each list.
The TOC links in the same sidebar pass: 25.5px tall, 25.5px apart.

The shared rule gives the inline <a> padding-top/padding-bottom: 0.2rem with line-height: 1.1rem.
Vertical padding on an inline element does not push the next line down, so the clickable boxes overlap:

https://github.com/quarto-dev/quarto-cli/blob/cda41021442b20964e10e265b9dcdf81f490c18e/src/resources/formats/html/bootstrap/_bootstrap-rules.scss#L1385-L1395

The TOC links are not affected because they have the nav-link class, which Bootstrap makes display: block, so their padding does push the next link down:

https://github.com/quarto-dev/quarto-cli/blob/cda41021442b20964e10e265b9dcdf81f490c18e/src/resources/formats/html/bootstrap/dist/scss/_nav.scss#L26-L27

The same rule also covers .toc-actions and .quarto-alternate-notebooks, which I did not measure.

Related:

  • #15096, the same kind of problem in the website sidebar.
  • #15389, these three groups are hidden on narrow screens. A fix there may move them.
Steps to reproduce
---
title: Links
toc: true
format:
  html:
    other-links:
      - text: Example one
        href: https://example.org/one
      - text: Example two
        href: https://example.org/two
    code-links:
      - text: Code one
        href: https://example.org/code1
        icon: file-code
      - text: Code two
        href: https://example.org/code2
        icon: file-code
  typst: default
  docx: default
---

## First

Text.

## Second

Text.

Open the HTML at 1400px wide, then run getBoundingClientRect() on the sidebar links, or run axe-core with the wcag22aa tag.

Actual behavior
Links display Height Distance between tops
TOC block 25.5px 25.5px
Other Formats inline 24.8px 20.4px
Other Links inline 24.8px 20.4px
Code Links inline 24.8px 20.4px

axe-core 4.14.1 (also 4.10.3, the bundled version), on the first link of each list:

target-size: Target has insufficient size because it is partially obscured (smallest space is 50.4px by 20.4px, should be at least 24px by 24px)
Target has insufficient space to its closest neighbors. Safe clickable space has a diameter of 20.4px instead of at least 24px.

(The other two lists give a 16px diameter.)

Expected behavior

Targets of at least 24 x 24px that do not overlap, or the spacing that 2.5.8 allows.

Your environment
  • IDE: none (terminal), Chromium via Playwright
  • OS: Windows 11
  • Same with Quarto 1.11.9, 1.12.3 and current main (cda4102).
Quarto check output
Quarto 1.12.3
[>] Checking versions of quarto binary dependencies...
      Pandoc version 3.13.0: OK
      Dart Sass version 1.107.1: OK
      Deno version 2.9.8: OK
      Typst version 0.15.1: OK
[>] Checking versions of quarto dependencies......OK
[>] Checking Quarto installation......OK
      Version: 1.12.3
[>] Checking tools....................OK
      TinyTeX: v2026.11
      VeraPDF: 1.30.3
      Chrome Headless Shell: (not installed)
Vorherrschende Sprache
JavaScript
Sterne
6.2k
Forks
492
Ø Merge
15 Std. 15 Min.
Gemergte PRs (30 T.)
94

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus quarto-dev/quarto-cli

Alle Issues in quarto-dev/quarto-cli

Ähnliche Issues

Weitere Issues zu JavaScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.