Git Product home page Git Product logo

twigcs-a11y's Introduction

twigcs-a11y

This is a TwigCS accessibility ruleset. It statically checks twig templates for known accessibility issues.

The ruleset is inspired by Deque's Axe Linter

Note: Automated tests do not guarantee your site is accessible. Manual testing is the only way to make sure.

Want to learn more about creating accessible websites? Check out The A11Y Collective.

Installation

composer require --dev nielsdeblaauw/twigcs-a11y

Use

vendor/bin/twigcs --ruleset \\NdB\\TwigCSA11Y\\Ruleset

Example Output

./tests/test.twig
l.2 c.0 : ERROR [A11Y.TabIndex] Invalid 'tabindex'. Tabindex must be 0 or -1. Found `tabindex=1>.`
l.12 c.20 : ERROR [A11Y.TabIndex] Invalid 'tabindex'. Tabindex must be 0 or -1. Found `tabindex=test.`
l.12 c.53 : ERROR [A11Y.TabIndex] Invalid 'tabindex'. Tabindex must be 0 or -1. Found `tabindex='test'.`
l.16 c.0 : ERROR [A11Y.BannedHTMLTags] Tag 'marquee' is dissallowed. Found `<marquee>`.
l.18 c.0 : ERROR [A11Y.BannedHTMLTags] Tag 'blink' is dissallowed. Found `<blink>`.
5 violation(s) found

For additional options read the TwigCS documentation.

Rules

The following rules are implemented as part of this ruleset.

TabIndex

Axe Tabindex rule description.

Using a non 0 or -1 value for tabindex results in unexpected behaviour for keyboard users. Variables in the tabindex property of an element are considered invalid.

BannedHTMLTags

Axe Blink rule description.

Axe Marquee rule description.

The blink and marquee tags are disallowed from use. These elements can cause issues for users with cognitive disabilities.

AriaRoles

Axe aria-roles rule description.

Catches invalid Aria role values. Typo's, non-standard and dynamic roles are not allowed.

Invalid roles can not be correctly interpreted by assistive technology.

Roadmap

The idea is to implement as many rules as possible from the Axe Linter ruleset.

twigcs-a11y's People

Contributors

nielsdeblaauw avatar mpparsley avatar

Stargazers

Snoweuph avatar  avatar Timo Hubois avatar Richard avatar sasezaki avatar Tristan Maindron avatar Vadym Bondarenko avatar Mathieu Santostefano avatar

Watchers

 avatar James Cloos avatar

twigcs-a11y's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.