Skip to content

fix(html): prepend floating color-scheme toggle - #14876

Closed
johnfinnerty-nz wants to merge 1 commit into
quarto-dev:mainfrom
johnfinnerty-nz:jftc/issue-14838-toggle-dom-order
Closed

fix(html): prepend floating color-scheme toggle#14876
johnfinnerty-nz wants to merge 1 commit into
quarto-dev:mainfrom
johnfinnerty-nz:jftc/issue-14838-toggle-dom-order

Conversation

@johnfinnerty-nz

Copy link
Copy Markdown

Description

Place the floating color-scheme toggle container first in the body so its DOM order matches its visual position. Add a Playwright assertion that protects the insertion order.

Closes #14838

Testing

  • npx playwright test tests/html-color-scheme-toggle.spec.ts --list (9 tests discovered)
  • npx prettier --check src/resources/formats/html/templates/quarto-html-after-body.ejs tests/integration/playwright/tests/html-color-scheme-toggle.spec.ts
  • Source contract check and git diff --check

Full browser execution was not run because the generated fixture sites and browser dependencies are not available in this checkout.

Checklist

I have (if applicable):

  • referenced the GitHub issue this PR closes
  • updated the appropriate changelog in the PR
  • ensured the present test suite passes
  • added new tests
  • created a separate documentation PR in Quarto's website repo and linked it to this PR
AI-assisted PR
  • AI tool used: OpenAI Codex
  • Codebase grounding: Local clone of quarto-dev/quarto-cli
  • Human review: John Finnerty reviewed the prepared change summary and authorized submission. Verification performed by Codex is listed above.

@posit-snyk-bot

posit-snyk-bot commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@cscheid

cscheid commented Sep 9, 2026

Copy link
Copy Markdown
Member

What bug does this fix? We're not inclined to make changes to everyone's web pages with little reason.

@cscheid
cscheid marked this pull request as draft September 9, 2026 21:03
@johnfinnerty-nz

Copy link
Copy Markdown
Author

Thanks for asking. The issue I was trying to address is the focus-order mismatch documented in #14838: on a plain document, the floating color-scheme toggle is drawn at the top right but appended to the end of body, so keyboard and screen-reader users reach it after the page content. It is a usability concern, not a WCAG failure.

I agree that changing DOM order on every affected page needs stronger regression evidence, especially around theme selectors and full browser behavior. I did not complete that validation, so I am closing this rather than asking the project to accept an under-tested global change. Sorry for the noise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

a11y: the floating color-scheme toggle is last in reading and focus order

3 participants