Skip to content

Commit

Permalink
added 1.0.0 files
Browse files Browse the repository at this point in the history
  • Loading branch information
jack__ committed Aug 8, 2018
0 parents commit 7b0cad1
Show file tree
Hide file tree
Showing 5 changed files with 113 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
@@ -0,0 +1,3 @@
.DS_STORE
*.log
node_modules
35 changes: 35 additions & 0 deletions index.js
@@ -0,0 +1,35 @@
module.exports = function({ addUtilities }) {
const screenReaderUtils = {
'.sr-only': {
position: 'absolute',
width: '1px',
height: '1px',
padding: '0',
overflow: 'hidden',
clip: 'rect(0, 0, 0, 0)',
whiteSpace: 'nowrap',
border: '0'
},

'.sr-only-focusable': {
'&:active': {
position: 'static',
width: 'auto',
height: 'auto',
overflow: 'visible',
clip: 'auto',
whiteSpace: 'normal'
},
'&:focus': {
position: 'static',
width: 'auto',
height: 'auto',
overflow: 'visible',
clip: 'auto',
whiteSpace: 'normal'
}
}
}

addUtilities(screenReaderUtils)
}
5 changes: 5 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 27 additions & 0 deletions package.json
@@ -0,0 +1,27 @@
{
"name": "tailwindcss-accessibility",
"version": "1.0.0",
"description": "A Tailwind CSS plugin that adds additional functionality to help improve accessibility.",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/jack-pallot/tailwindcss-accessibility.git"
},
"keywords": [
"tailwind",
"tailwindcss",
"accessibility",
"a11y",
"plugin"
],
"author": "Jack Pallot",
"license": "MIT",
"bugs": {
"url": "https://github.com/jack-pallot/tailwindcss-accessibility/issues"
},
"homepage": "https://github.com/jack-pallot/tailwindcss-accessibility#readme",
"dependencies": {}
}
43 changes: 43 additions & 0 deletions readme.md
@@ -0,0 +1,43 @@
# Tailwind CSS Accessibility Plugin

A Tailwind CSS plugin that adds additional functionality to help improve accessibility.

### Installing

npm install tailwindcss-accessibility

or

yarn add tailwindcss-accessibility


Simply require the installed plugin directly to your Tailwind config:

plugins: [
require('tailwindcss-accessibility')
]

### Usage

For usage on individual elements:

<span class="sr-only">
Screen readers only
</span>

Use on focused only elements (skip links etc):

<a class="sr-only sr-only-focusable" href="#content" tabindex="1">
Skip to main content
</a>

### Utilities

By default the class utils are taken from Bootstrap 4, a highly battle-tested framework:

.sr-only {}
.sr-only-focusable {}

### Contributions

The goal of this project is to be a single source for as many relevant CSS accessibility helpers as possible. If we're missing something, or you would like to contribute, post an issue or PR.

0 comments on commit 7b0cad1

Please sign in to comment.