Giter Site home page Giter Site logo

access_lint's Introduction

access_lint Build Status Gem Version Code Climate Coverage Status

Run web accessibility audits on urls or files, from the command line or within Ruby.

About

AccessLint uses the Accessibility Developer Tools javascript library to make assertions on the DOM via PhantomJS. The rules that are applied are listed below.

Installation

First, install PhantomJS (full guide). On OS X:

$ brew install phantomjs

Then install the rubygem:

$ gem install access_lint

Usage

Command Line

From the command line, specify a url or filename to be audited:

$ access_lint audit http://twitter.com # url or a path to a file
# results ...

Ruby

Run the audit from a Ruby application like so

$ irb
> require 'access_lint'
=> true
> AccessLint::Audit.new('http://twitter.com').run
=> results ...

Results Object

{
    "PASS": [                                                           # Status group
        { 
            "element_names": ["<p class=\"foo\">relevant element</p>"], # applicable DOM elements
            "severity": "WARNING",                                      # 'WARNING' or 'SEVERE'
            "status": "PASS",                                           # 'PASS', 'FAIL', or 'NA'
            "title": "Some description"                                 # rule description
        }, 
        { ... }
    ],
    "NA": [ { ... } ],
    "FAIL": [ { ... }]
]

Rules

For full descriptions of the audit rules, visit the Accessibility Developer Tools project wiki

  • Audio elements should have controls
  • ARIA state and property values must be valid
  • Elements with ARIA roles must use a valid, non-abstract ARIA role
  • Controls and media elements should have labels
  • These elements are focusable but either invisible or obscured by another element
  • Images should have an alt attribute
  • The purpose of each link should be clear from the link text
  • Text elements should have a reasonable contrast ratio
  • role=main should only appear on significant elements
  • Meaningful images should not be used in element backgrounds
  • aria-labelledby attributes should refer to an element which exists in the DOM
  • The web page should have a title that describes topic or purpose
  • Elements with ARIA roles must have all required attributes for that role
  • Video elements should use elements to provide captions

Roadmap

Visit the project backlog: https://www.pivotaltracker.com/s/projects/985186.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

access_lint's People

Contributors

ckundo avatar jaimeiniesta avatar

Watchers

 avatar  avatar  avatar

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.