@substrate-system/a11y
v0.0.2
Published
Accessibility helpers
Downloads
52
Readme
package name here
Factoring out some common CSS utilities, so there is less duplication across projects.
install
npm i -S @substrate-system/a11y
API
This package looks for these classes:
visually-hidden
Use this to create accessible buttons with no visible text.
See this article.
<button class="${classes}">
<svg><!-- icon here --></svg>
<span class="visually-hidden">Button text</span>
</button>
Use
Import CSS
import '@substrate-system/a11y'
Or minified:
import '@substrate-system/a11y/min'
Minified CSS
This package exposes minified CSS files. You can copy them to a location that is accessible to your web server, then link to them directly in HTML.
copy
cp ./node_modules/@substrate-system/a11y/dist/index.min.css ./public/a11y.css
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="./a11y.css">
</head>
</html>