fix(html): prepend floating color-scheme toggle - #14876
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
|
What bug does this fix? We're not inclined to make changes to everyone's web pages with little reason. |
|
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. |
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.tsgit diff --checkFull browser execution was not run because the generated fixture sites and browser dependencies are not available in this checkout.
Checklist
I have (if applicable):
AI-assisted PR
quarto-dev/quarto-cli