Package Exports
- passes-wcag
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (passes-wcag) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Passes WCAG
Evaluate whether two colors have sufficient contrast to pass WCAG requirements.
Doesn't handle transparency as of yet.
Installation
npm i passes-wcagUsage
import {
passesWcagAaLargeText,
passesWcagAa,
passesWcagAaa,
} from 'passes-wcag';
passesWcagAa('black', '#fff'); // true
passesWcagAaLargeText('rgb(1, 1, 1)', 'rgb(250, 248, 247)') // true
passesWcagAaa('black', 'rgb(0, 0, 0)') // falseSignature
passesWcagAaLargeText(color1: string, color2: string) => boolean
passesWcagAa(color1: string, color2: string) => boolean
passesWcagAaa(color1: string, color2: string) => booleanContributing
I appreciate your issues and PRs on Github!
Testing
yarn build && yarn testReleasing
This project uses np.
- Make sure your changes are in master
- Run
yarn release - Follow the interactive release guide