@area17/fractal-axe-a11y

1.0.1 • Public • Published

fractal-axe-a11y

This addon adds accessibility testing to your Fractal components using Axe.

Installation

To install Fractal Axe A11y to your Fractal instance use:

npm install @area17/fractal-axe-a11y

Configuration

  1. Add the following lines to your fractal.config.js project configuration:
// require fractal theme
const mandelbrot = require('@frctl/mandelbrot');
const axeA11y = require('@area17/fractal-axe-a11y');

// configure theme
const theme = mandelbrot({ ... })

// Update theme config with a11y panel
axeA11y(theme);

// init theme
fractal.web.theme(theme);
  1. Include preview-a11y.js in Fractal preview template:
<script src="{{ path '/axe-a11y/a11y.js' }}"></script>
  1. Optionally - To test just the component and not the entire preview page, add a data attribute of data-axe-test-target to your preview template to the container of your main yield:
<main data-axe-test-target>
  {{{ yield }}}
</main>

Readme

Keywords

none

Package Sidebar

Install

npm i @area17/fractal-axe-a11y

Weekly Downloads

9

Version

1.0.1

License

MIT

Unpacked Size

897 kB

Total Files

11

Last publish

Collaborators

  • ptrckvzn
  • quentinrenard
  • mrdoinel
  • 13twelve
  • m4n1ok
  • mazinoukah
  • mrtimbrook