Pa11y CI checks pages without the site's own CSS
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- github-actions, html
- Domain
- accessibility, ci-cd
Research direction
The Pa11y job in .github/workflows/ci.yml passes built files from _site to pa11y as file paths, and the run_pa11y function turns each find result into that path. Start by reading both, then serve _site over HTTP in the job and build http://localhost:4000/... URLs from the same find output. Done when Pa11y runs against pages that load /assets/css/custom.css and the workflow still passes or reports real contrast findings.
Written by the indexing model from the issue text.
Description
Summary
The Pa11y job in .github/workflows/ci.yml runs on built files straight from disk (pa11y "$file" where $file is _site/…/index.html). Opened that way, site-relative URLs like /assets/css/custom.css resolve to file:///assets/css/custom.css, which doesn't exist. So Pa11y has never loaded custom.css.
Until now Pico still loaded, because it came from jsDelivr with a full https:// URL. Self-hosting Pico (#182) moves it to /assets/css/ too. After that, Pa11y checks completely unstyled pages, and its colour-contrast results stop meaning anything. It will probably report fewer problems than are really there.
The same applies to /assets/js/*, so Pa11y also never runs the site's JavaScript.
Suggested fix
Serve _site over HTTP in the job and point Pa11y at URLs:
- run: |
npx --yes http-server _site -p 4000 -s &
npx --yes wait-on http://localhost:4000
Then have run_pa11y build http://localhost:4000/<subdir>/ from the find result instead of using the file path. This may turn up contrast findings Pa11y has been missing, such as #184.
Generated by Claude Code
- Dominant language
- HTML
- Stars
- 1
- Forks
- 6
- Avg merge
- 4h 28m
- Merged PRs (30d)
- 4
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from CivicTechTO/civictech.ca
-
good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
CivicTechTO/civictech.ca#189 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
CivicTechTO/civictech.ca#186 ·
-
accessibility
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
CivicTechTO/civictech.ca#184 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 62/100
CivicTechTO/civictech.ca#101 ·
-
accessibility good first issue
Difficulty 1/5 Under an hour Newbie friendliness 76/100
CivicTechTO/civictech.ca#97 · 2 comments ·
All issues in CivicTechTO/civictech.ca
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
pwncollege/dojo#1188 ·
Maintainers usually reply within 1 day
-
Frontend
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
a11y - Keyboard focus not visible on single react-select widgets (only 2px sliver on hidden input)Possibly taken @wesleybl claimed this today. Open01 type: bug 21 status: confirmed
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
[a11y] Closing the board dialog with Escape drops keyboard focus to <body>Possibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Uuriko/project-room#3688 ·
Maintainers usually reply within 1 day
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
devops-thiago/ThrillhouseBot#1132 ·
Maintainers usually reply within 1 day