Giter Site home page Giter Site logo

jamesrweb / accessible-html Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tesk9/accessible-html

0.0 1.0 0.0 363 KB

view helpers enforcing accessible practices

Home Page: https://tesk9.github.io/accessible-html/

License: BSD 3-Clause "New" or "Revised" License

Elm 100.00%

accessible-html's Introduction

Build Status

accessible-html

tesk9/accessible-html makes writing accessible websites easier.

Using this Library

Use the Accessibility module to encourage accessible practices:

import Accessibility as Html exposing (..)

There are also attribute helpers that enable you to do some pretty advanced cool stuff! Many of these helpers are not necessary when writing semantically correct HTML5 code, but you will still need some of them when rolling your own dynamic widgets. The import expressions below point out some of the helpers that you are more likely to need:

import Accessibility.Aria exposing (controls, labelledBy, describedBy)
import Accessibility.Key exposing (onKeyDown, left, right, enter, escape)
import Accessibility.Landmark exposing (search)
import Accessibility.Live exposing (atomic, busy, liveAssertive, livePolite)
import Accessibility.Role exposing (presentation)
import Accessibility.Style exposing (invisible)

Resources

A great place to start is reading about the principles of accessibility. By starting out with the design goals of Perceivable, Operable, Understandable, and Robust, you'll be able to find the information you need when reading the WAI-ARIA spec.

If you know you want to make a specific kind of widget, the Web Accessibility Initiative has specific authoring best practices and recommendations for you, along with really great examples.

Modules

Accessibility

This section extends the html library to include tab* elements, radio, inputText, checkbox, and more. It also shadows the elm/html library to encourage limiting interactive behavior to html5 interactable elements.

This module may be removed in a future version of this library.

Accessibility.Aria

This section includes roles for working with sets, grids, controls, and more. This section also includes attributes indicating state: is a given element expanded or disabled or pressed?

Accessibility.Key

When making widgets, you will need to add keyboard shortcuts to make keyboard navigation possible.

For instance, space and on enter should activate a button,space should change a checkbox's state, escape should close a modal, and up, down, left, and right should navigate focus in a menu.

Accessibility.Landmark

You're likely to only want search from this section unless you're not using HTML5 elements.

Accessibility.Live

Describe which sections of the page are changing over time, and how aggressively assistive technologies should notify the user about those changes.

Accessibility.Role

Much of the time, sticking with HTML5 is better than using these properties. However, the WAI-ARIA spec moves at a different pace than the HTML spec--and user agent technologies are another factor entirely! You are likely to find yourself using a combination of these Accessibility.Role attributes.

Accessibility.Style

This section contains helpers for changing the look of your site without making it unusable.

For instance, if you prefer to use placeholders to convey what sort of values belong in an input, you can use the invisible helper to remove the label for screenviewers without removing it for screenreaders.

accessible-html's People

Contributors

derrickreimer avatar jamesrweb avatar jfmengels avatar ryan-haskell avatar shahnhogan avatar tesk9 avatar tryzniak avatar

Watchers

 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.