Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@acot/acot-preset-wcag

acot-a11y1.2kMIT0.0.19TypeScript support: included

A WCAG-based rule set for acot.

acot, acot-preset, wcag

readme

@acot/acot-preset-wcag

A WCAG-based rule set for acot.

Installation

Install via npm:

$ npm install --save-dev @acot/acot-preset-wcag

Usage

Add @acot/wcag to the presets field of the acot config file. then configure the rules you want to use under the rules section.

{
  "presets": ["@acot/wcag"],
  "rules": {
    "@acot/wcag/button-has-name": "error"
  }
}

You can also enable all the recommended rules for our preset. Add preset:@acot/wcag/recommended in extends:

{
  "extends": ["preset:@acot/wcag/recommended"]
}

Supported Rules

Name Summary :heavy_check_mark:
@acot/wcag/dialog-focus Move focus to inside dialog or set dialog after trigger. :heavy_check_mark:
@acot/wcag/focusable-has-indicator Focusable element has a focus indicator. :heavy_check_mark:
@acot/wcag/img-has-name The img element or img role MUST has name. :heavy_check_mark:
@acot/wcag/interactive-has-enough-size The size of the target for pointer inputs is at least 44 by 44 CSS pixels. :heavy_check_mark:
@acot/wcag/interactive-has-name Interactive elements MUST has name. :heavy_check_mark:
@acot/wcag/interactive-supports-focus T.B.A
@acot/wcag/invalid-id-reference The target of the ID reference or ID reference list MUST exist in the same document. :heavy_check_mark:
@acot/wcag/link-has-name Link MUST has name. :heavy_check_mark:
@acot/wcag/page-has-title Web pages have titles that describe topic or purpose. WCAG 2.1 - 2.4.2. :heavy_check_mark:
@acot/wcag/page-has-valid-lang The html element MUST has a valid lang attribute. :heavy_check_mark:

Coverage WCAG 2.1 by @acot/acot-preset-wcag

Perceivable

1.1 Text Alternatives

Success criteria acot rules
1.1.1 Non-text Content -

1.2 Time-based Media

Success criteria acot rules
1.2.1 Audio-only and Video-only (Prerecorded) -
1.2.2 Captions (Prerecorded) -
1.2.3 Audio Description or Media Alternative (Prerecorded) -
1.2.4 Captions (Live) -
1.2.5 Audio Description (Prerecorded) -
1.2.6 Sign Language (Prerecorded) -
1.2.7 Extended Audio Description (Prerecorded) -
1.2.8 Media Alternative (Prerecorded) -
1.2.9 Audio-only (Live) -

1.3 Adaptable

Success criteria acot rules
1.3.1 Info and Relationships @acot/wcag/invalid-id-reference
1.3.2 Meaningful Sequence -
1.3.3 Sensory Characteristics -
1.3.4 Orientation -
1.3.5 Identify Input Purpose -
1.3.6 Identify Purpose -

1.4 Distinguishable

Success criteria acot rules
1.4.1 Use of Color -
1.4.2 Audio Control -
1.4.3 Contrast (Minimum) -
1.4.4 Resize text -
1.4.5 Images of Text -
1.4.6 Contrast (Enhanced) -
1.4.7 Low or No Background Audio -
1.4.8 Visual Presentation -
1.4.9 Images of Text (No Exception) -
1.4.10 Reflow -
1.4.11 Non-text Contrast -
1.4.12 Text Spacing -
1.4.13 Content on Hover or Focus -

2. Operable

2.1 Keyboard Accessible

Success criteria acot rules
2.1.1 Keyboard @acot/wcag/interactive-supports-focus
2.1.2 No Keyboard Trap -
2.1.3 Keyboard (No Exception) -
2.1.4 Character Key Shortcuts -

2.2 Enough Time

Success criteria acot rules
2.2.1 Timing Adjustable -
2.2.2 Pause, Stop, Hide -
2.2.3 No Timing -
2.2.4 Interruptions -
2.2.5 Re-authenticating -
2.2.6 Timeouts -

2.3 Seizures and Physical Reactions

Success criteria acot rules
2.3.1 Three Flashes or Below Threshold -
2.3.2 Three Flashes -
2.3.3 Animation from Interactions -

2.4 Navigable

Success criteria acot rules
2.4.1 Bypass Blocks -
2.4.2 Page Titled @acot/wcag/page-has-title
2.4.3 Focus Order @acot/wcag/dialog-focus
2.4.4 Link Purpose (In Context) @acot/wcag/link-has-name
2.4.5 Multiple Ways -
2.4.6 Headings and Labels -
2.4.7 Focus Visible @acot/wcag/focusable-has-indicator
2.4.8 Location -
2.4.9 Link Purpose (Link Only) -
2.4.10 Section Headings -

2.5 Input Modalities

Success criteria acot rules
2.5.1 Pointer Gestures -
2.5.2 Pointer Cancellation -
2.5.3 Label in Name -
2.5.4 Motion Actuation -
2.5.5 Target Size @acot/wcag/interactive-has-enough-size
2.5.6 Concurrent Input Mechanisms -

3. Understandable

3.1 Readable

Success criteria acot rules
3.1.1 Language of Page @acot/wcag/page-has-valid-lang
3.1.2 Language of Parts -
3.1.3 Unusual Words -
3.1.4 Abbreviations -
3.1.5 Reading Level -
3.1.6 Pronunciation -

3.2 Predictable

Success criteria acot rules
3.2.1 On Focus -
3.2.2 On Input -
3.2.3 Consistent Navigation -
3.2.4 Consistent Identification -
3.2.5 Change on Request -

3.3 Input Assistance

Success criteria acot rules
3.3.1 Error Identification -
3.3.2 Labels or Instructions -
3.3.3 Error Suggestion -
3.3.4 Error Prevention (Legal, Financial, Data) -
3.3.5 Help -
3.3.6 Error Prevention (All) -

4. Robust

4.1 Compatible

Success criteria acot rules
4.1.1 Parsing @acot/wcag/invalid-id-reference
4.1.2 Name, Role, Value @acot/wcag/link-has-name
4.1.3 Status Messages -

Concept

Interactive content

Some rules deal with interactive content. The definition of interactive content to be audited is as follows:

  1. 3.2.5.2.7 Interactive content compliant elements.
  2. Elements with a role attribute that conforms to the above.
  3. Focusable elements.

changelog

Change Log

All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.

0.0.19 (2022-06-05)

Bug Fixes

  • acot-reporter-pretty: fix stat bugs in testcase summary (f9a2552)
  • cli: support non TTY environment on preset test (48e3ce0)

Features

  • acot-preset-wcag: add invalid-id-reference rule (2a70d7e)
  • acot-runner-sitemap: add retry behavior to sitemap fetcher (fcc1293)
  • cli: add parallel option to preset test command (32f7e1e)
  • document: add progress indicator to documentation testing (756158b)

0.0.18 (2022-05-11)

Features

  • acot-preset-wcag: add ignore option to dialog-focus rule (959bcbc)
  • acot-preset-wcag: add ignore option to img-has-name rule (36a152e)
  • acot-preset-wcag: add ignore option to interactive-has-enough-size rule (640a0aa)
  • acot-preset-wcag: add ignore option to interactive-has-name rule (bcf6119)
  • acot-preset-wcag: add ignore option to interactive-supports-focus rule (a563858)
  • acot-preset-wcag: add ignore option to link-has-name rule (97e01a5)
  • utils: add isElementMatches utilify function (53c4c58)

0.0.17 (2022-05-10)

Bug Fixes

  • acot-preset-wcag: improve rule apply for hidden elements (5f80cd8)

Features

  • utils: add isElementHidden utility function (2529cf4)

Performance Improvements

  • acot-preset-wcag: improve focusable-has-indicator performance (a795308)

0.0.17-canary.3 (2022-05-06)

Note: Version bump only for package acot

0.0.17-canary.2 (2022-05-06)

Note: Version bump only for package acot

0.0.17-canary.1 (2022-05-05)

Note: Version bump only for package acot

0.0.17-canary.0 (2022-05-05)

Bug Fixes

  • cli: fix default value for parallel option (9325b5a)

Features

  • acot-runner-sitemap: add behavior to merge config.paths with collected paths (fdcf2aa)

Reverts

  • core: remove immutable rule flags (7bd940b)

0.0.16 (2022-05-01)

Bug Fixes

Features

  • acot-runner-storybook: add collect stories timeout error (c4ebb75)
  • acot-runner-storybook: add support storybook v6 (691129c)

0.0.15 (2022-03-27)

Bug Fixes

  • update aom feature flag (040a321)

Features

  • upgrade puppeteer to v13 (6598c99)

0.0.14 (2022-01-03)

Note: Version bump only for package acot

0.0.14-canary.2 (2022-01-03)

Bug Fixes

  • core: fix validation logic of rule options (ae9fdbd)

Features

  • acot-reporter-github: add debug options (e492e54)

0.0.14-canary.1 (2022-01-03)

Bug Fixes

  • acot-reporter-github: fix verbose log (fb19a81)

0.0.14-canary.0 (2022-01-03)

Features

0.0.13 (2021-10-10)

Features

  • allow multiple reporters (437022c)

0.0.13-canary.0 (2021-08-17)

Bug Fixes

  • update dependency is-ci to v3 (4282333)

Features

  • connection url includes path (652b3ae)

0.0.12 (2021-04-18)

Features

  • acot-runner-sitemap: add timeout options (1a27081)
  • acot-runner-storybook: add timeout options (41b06f9)

0.0.11 (2021-04-12)

Note: Version bump only for package acot

0.0.10 (2021-04-11)

Note: Version bump only for package acot

0.0.10-canary.0 (2021-04-04)

Bug Fixes

  • fix summary duration bug (a5fb2d3)
  • h1 (4982414)
  • update dependency boxen to v5 (271bb1f)
  • update dependency execa to v5 (456b0de)
  • update dependency fastify-static to v4 (4d69df7)
  • Fix omission of version specification in debug package (85f8ea4)
  • Minor bug fixes that occur during Audit (0ec7b94)
  • acot-preset-wcag: fix focusable-has-indicator bug (4488ca1)
  • acot-preset-wcag: fix type assertion (1a5b05a)
  • acot-runner: fix dependencies (00402e9)
  • cli: Fix a bug in init subcommand (982553b)
  • cli: Fix internal package import paths (5081a27)
  • core: Add element2selector error handling (4f1a9e5)
  • core: Fix a bug in which the queue is executed without waiting (51ddb83)
  • core: Fix a bug that BrowserPool hangs (93da5cb)
  • core: Fix a bug that prevented closing a used page (fd6e55f)
  • core: Fix navigation wait logic (1178dc9)
  • core: Human readable output log of browser console (10c6c27)
  • doc: Fix trivial typos in README.md (704019f)
  • document: fix dependencies (c49533a)
  • mock-logger: Tweak (ab9210d)
  • preset-wcag: Fix immutable flags on WCAG rules (f383f44)
  • reporter: Fix a bug that PrettyReporter hangs in the case of many URLs (7248532)
  • runner-storybook: Wait for configuring store (9daccd0)
  • Fix a bug in the rule performance tracker (07e8f36)
  • schema-validator: Fix a duplicate ValidationError export (30caad3)

Features

  • Add rule result for pretty reporter (f668f8a)
  • Improve progress display (pretty reporter) (dc4e9e1)
  • Initial implements (68f46a2)
  • acot-preset-wcag: add link-has-name (e77f56b)
  • cli: add --(reporter|runner)-with options (64944e1)
  • cli: Add --no-open options for preset serve sub-command (0a43e58)
  • cli: add @acot/sitemap to init sub-command (336196a)
  • cli: Add filter logic to debug flag (738c35d)
  • cli: add update-notifier (84fe911)
  • cli: For CI, enable verbose flag (0cd3e16)
  • cli: Improve UX for init sub-command (04e9aed)
  • cli: Skip ask about puppeteer if installed (350dc09)
  • connection: use GET request instead of HEAD request #34 (5a48d8a)
  • core: add chromium auto detection for BrowserPool (21f7228)
  • core: Add cleanup process for the page before perform immutable rule (c4e4820)
  • core: Add debug log (c0b9837)
  • core: switch to help from tags (7ac5678)
  • document: add pattern to specify test target (67c319f)
  • add @acot/acot-runner-sitemap package (9a760b7)
  • add @acot/mock package (fb6e4ba)
  • core: Performance improvements with immutable rules (572edef)
  • document: Add acot-head flag to test <head> in rule documentation (a1c5760)
  • document: Change summary extraction logic (361cd2b)
  • document: Upgrade design of preset preview server (21d555b)
  • plugin/wcag: Add page-has-title rule (4353cab)
  • preset: add dialog-focus rule (29ec6ba)
  • preset-wcag: Add page-has-valid-lang rule (8ee766c)
  • preset-wcag: add rule focusable-has-indicator (3bdc1fe)
  • preset-wcag: Add some rules to recommended set (6bafccc)
  • runner-storybook: Add filter options for storybook runner (c77d6bf)
  • types: add ComputedAccessibleNode type (bcd4322)
  • add img-has-name rule (1e72566)
  • add interactive-has-name rule to acot-plugin-wcag instead of button-has-name (95f8e2c)

Performance Improvements

  • document: Improve preset test performance (51aa3d2)