This repository contains a site designed to demonstrate a wide variety of accessibility failures.
The site folder contains the code used to build the site, powered by Astro.
If you don't have one, we recommend installing an IDE that supports multiple languages (Javascript, HTML/CSS, etc).
Visual Studio Code is recommended, as Astro provides an
extension
which includes intellisense, syntax highlighting, and formatting of .astro files.
Note: npm commands should be run within the site directory.
- Install the LTS version of Node on your development machine.
- Run
npm installwithin thesitedirectory to install the JS dependencies. - Run
npm startwithin thesitedirectory to run the development server.
Other useful npm commands within the site directory:
npm run checkto check for TypeScript errorsnpm run buildto create a production buildnpm run previewto preview the production build created bynpm run build
This repository includes components designed to allow implementing both "broken" and "fixed" variants side-by-side. The above commands run the "broken" variant by default.
To produce the "fixed" output:
npm run dev:fixedto run the dev servernpm run build:fixedto run a build (previewable as before vianpm run preview)
Note that the default "broken" variant has been the initial focus of development, so the "fixed" variant is even more work-in-progress.
- Install Docker Desktop or another way to run a containerized environment.
- If on Windows, we recommend installing the Linux Subsystem to help performance, but it’s not required. See configuring Docker Desktop to use WSL 2.
- There are a series a
makecommands to help you run the commands in Docker. To use those, you'll need to install a way to runmake.
- On Windows, use the Linux Subsystem or chocolatey.
- On Mac, install the Xcode client tools or use homebrew.
- If preferred, install some integration with the IDE you are using instead.
- For instance,
Makefilesupport for VS Code
- For instance,
- Run
make serveto launch the container, install the dependencies and run the development server.
A couple of components exist to help with implementing broken and fixed variants of features side-by-side. These work with the commands listed above to produce the broken and fixed variants.
<Fixable as="tagname" ... broken={...} fixed={...}>
<Fixable as={Component} ... broken={...} fixed={...}>as: specifies the tag (string) or component (constructor) to render- Top-level attributes are common between both broken and fixed variants
- Any attributes specific to either the broken or fixed variant should be
defined within
brokenorfixed(each of these is optional)
<FixableRegion>
(broken rendering)
<... slot="fixed">
(fixed rendering)
</...>
</FixableRegion>- Top-level elements are rendered for the broken variant
- The element with
slot="fixed"is rendered for the fixed variant- Multiple top-level elements can be rendered for the fixed variant by
nesting them under
<Fragment slot="fixed">
- Multiple top-level elements can be rendered for the fixed variant by
nesting them under
Breaks can be documented alongside their implementation.
In Astro files (for pages or components):
/**
* @break
* location: Home & Search
* wcag2: 2.2.2
* wcag3: Motion
* description: ...
*/In Markdown frontmatter (for collection entries):
breaks:
- location: Home & Search
wcag2: 2.2.2
wcag3: Motion
description: ...Properties:
- location - Indicates what part of the site contains the break;
must exist in
src/content/sections.json - wcag2 - WCAG 2 Success Criterion number(s)
- wcag3 - WCAG 3 Requirement(s)
- description - Description(s) of break(s)
wcag2, wcag3, and description may be lists.
Either wcag2 or wcag3 (or both) must be specified.
If a file documents many breaks that pertain to the same location,
it may be specified once up front via breaklocation instead, and
omitted from individual break definitions. If an individual definition
still defines location, it will override breaklocation.
In Astro files:
/** @breaklocation Home & Search */In Markdown frontmatter:
breaklocation: Home & Search