Skip to main content
Ungathered Thoughts

pa11y in Lando

Reading a post by Morgan on web performance and accessibility standards and I'm reminded of pa11y, a CLI tool for accessibility checking that we've used before.

Tools can't match expert assessment, but they can be useful to automate and frequency of checking can be a real boon to raising standards.

Here's pa11y in a Lando configuration - you can add the service and tooling entries below to some existing Lando environment, or use this entire config as-is for a standalone tool.

name: pa11y
type: node
service: pa11y
cmd: pa11y --config /pa11y-configs/pa11y.json

Once those are in an environment, you can use pa11y alongside your project:

$ lando pa11y --sitemap
$ lando pa11y

This uses the image made available via Gitlab's Accessibility Testing tools; you can use their configuration to test accessibility in your Gitlab CI pipelines too.

chris@thip:~/Projects/lando-pa11y$ lando pa11y --reporter cli

Welcome to Pa11y

> Running Pa11y on URL

Results for URL:

• Error: The html element should have a lang or xml:lang attribute which describes the language of the document.
├── WCAG2AA.Principle3.Guideline3_1.3_1_1.H57.2
├── html
└── Example Domai...</html><br><br>1 Errors</code></pre> </article> </main> <footer> </footer> <!-- Current page: /pa11y-in-lando/ --> </body> </html>