npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@acot/acot-preset-wcag

v0.0.19

Published

A WCAG-based rule set for acot.

Downloads

459

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.