a11y: the floating color-scheme toggle is last in reading and focus order
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 74/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- javascript
- Área
- accessibility, frontend
Línea de trabajo
Localiza el script after-body que inserta el conmutador de color-scheme e inspecciona cómo se añade su contenedor a body. Cambia la inserción para que el contenedor siga siendo un hijo directo y pase a ser el primer hijo; después verifica que su posición dibujada no cambie y que el orden de foco comience con el conmutador. Comprueba documentos simples con y sin un banner de título, incluidos los temas con una regla body > *:first-child.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Split from the review of #14739.
On a document with no navbar, the color-scheme toggle is injected by the after-body script and its container is appended to body, so it is the last element in the DOM. Reading order and focus order both follow DOM order here, since nothing sets tabindex. The toggle is drawn at the top right of the page, so it is the first control a sighted user sees and the last one a keyboard or screen reader user reaches.
Measured on a document with a title block banner (author link, affiliation link, DOI link):
visual order TOGGLE (top=17) -> title (top=42) -> A Person (226) -> Example Org (226) -> DOI (284)
focus order now A Person -> Example Org -> DOI -> body link -> TOGGLE
A website is not affected. There the toggle sits in the navbar and is reached in navbar order, matching where it is drawn.
This is not a WCAG failure. Focus order still preserves meaning and operability, and axe reports nothing. It is a usability wrinkle, and it predates #14739: the toggle was appended to body before that change as well.
Inserting the container at the start of body instead of appending it corrects the order and leaves the drawn position untouched:
prepended -> position: {"top":17,"fromRight":17} (unchanged)
prepended -> focus : TOGGLE -> A Person -> Example Org -> DOI -> body link
The container must stay a direct child of body: the toggle is positioned against the page, so any ancestor that establishes a containing block captures it (see #14739).
Two things to check before making the change:
- It alters focus order for every existing plain document with a light/dark theme pair.
- The container would become
body's first child, so anybody > *:first-childrule in a theme could pick it up.
On a plain document without a banner the toggle is drawn level with the title but to its right, so prepending puts it one position early rather than exactly right. That is still much closer than last on the page.
Part of #8706.
- Lenguaje dominante
- JavaScript
- Estrellas
- 6k
- Forks
- 458
- Merge medio
- 1 d 9 h
- PR fusionados (30 d)
- 41
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de quarto-dev/quarto-cli
-
binder bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 92/100
quarto-dev/quarto-cli#14907 · 3 comentarios ·
-
brand bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
quarto-dev/quarto-cli#14891 ·
-
brand bug html revealjs
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
quarto-dev/quarto-cli#14882 ·
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
quarto-dev/quarto-cli#14875 ·
-
Percent scripts: accept raw-string (r""") and '''-delimited markdown cells, as jupytext writes them Abiertoengines-jupyter enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
quarto-dev/quarto-cli#14850 · 2 comentarios ·
Todos los issues de quarto-dev/quarto-cli
Issues similares
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
babalae/bettergi-scripts-list#3674 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
vadimdemedes/ink#1029 ·
-
code-quality refactoring
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
langchain-ai/deepagents#6450 ·
-
optimization optimization:agents-md-curator
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
githubnext/gh-aw-cao#13143 ·