{"id":15280556,"url":"https://github.com/csstools/postcss-wcag-contrast","last_synced_at":"2025-03-30T11:31:32.810Z","repository":{"id":46116975,"uuid":"52172732","full_name":"csstools/postcss-wcag-contrast","owner":"csstools","description":"Check CSS for WCAG color contrast compliance","archived":true,"fork":false,"pushed_at":"2021-11-14T21:26:59.000Z","size":18,"stargazers_count":59,"open_issues_count":3,"forks_count":6,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-24T00:28:56.014Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/csstools.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-02-20T20:01:39.000Z","updated_at":"2024-12-27T18:43:56.000Z","dependencies_parsed_at":"2022-07-20T18:49:37.851Z","dependency_job_id":null,"html_url":"https://github.com/csstools/postcss-wcag-contrast","commit_stats":null,"previous_names":["jonathantneal/postcss-wcag-contrast"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csstools%2Fpostcss-wcag-contrast","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csstools%2Fpostcss-wcag-contrast/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csstools%2Fpostcss-wcag-contrast/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csstools%2Fpostcss-wcag-contrast/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/csstools","download_url":"https://codeload.github.com/csstools/postcss-wcag-contrast/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246314011,"owners_count":20757450,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-09-30T12:11:29.795Z","updated_at":"2025-03-30T11:31:32.785Z","avatar_url":"https://github.com/csstools.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WCAG Contrast [\u003cimg src=\"https://postcss.github.io/postcss/logo.svg\" alt=\"PostCSS Logo\" width=\"90\" height=\"90\" align=\"right\"\u003e][postcss]\n\n[![NPM Version][npm-img]][npm-url]\n[![Linux Build Status][cli-img]][cli-url]\n[![Windows Build Status][win-img]][win-url]\n[![Gitter Chat][git-img]][git-url]\n\n[WCAG Contrast] checks CSS for [color contrast compliance] with\n[Web Content Accessibility Guidelines (WCAG) 2.0].\n\n```css\n.header {\n  background-color: #444;\n  color: #000; /* throws a warning for a low contrast of only 2.2 */\n}\n\n.footer {\n  /* wcag-params: bold 14pt #777 */\n  color: #000; /* throws no warning when text is bold 14pt and contrast is 4.7 */\n}\n```\n\n## Usage\n\nAdd [WCAG Contrast] to your build tool:\n\n```bash\nnpm install postcss-wcag-contrast --save-dev\n```\n\n#### Node\n\nUse [WCAG Contrast] to process your CSS:\n\n```js\nrequire('postcss-wcag-contrast').process(YOUR_CSS);\n```\n\n#### PostCSS\n\nAdd [PostCSS] to your build tool:\n\n```bash\nnpm install postcss --save-dev\n```\n\nUse [WCAG Contrast] as a plugin:\n\n```js\npostcss([\n  require('postcss-wcag-contrast')()\n]).process(YOUR_CSS);\n```\n\n#### Gulp\n\nAdd [Gulp PostCSS] to your build tool:\n\n```bash\nnpm install gulp-postcss --save-dev\n```\n\nUse [WCAG Contrast] in your Gulpfile:\n\n```js\nvar postcss = require('gulp-postcss');\n\ngulp.task('css', function () {\n  return gulp.src('./src/*.css').pipe(\n    postcss([\n      require('postcss-wcag-contrast')()\n    ])\n  ).pipe(\n    gulp.dest('.')\n  );\n});\n```\n\n#### Grunt\n\nAdd [Grunt PostCSS] to your build tool:\n\n```bash\nnpm install grunt-postcss --save-dev\n```\n\nUse [WCAG Contrast] in your Gruntfile:\n\n```js\ngrunt.loadNpmTasks('grunt-postcss');\n\ngrunt.initConfig({\n  postcss: {\n    options: {\n      use: [\n        require('postcss-wcag-contrast')()\n      ]\n    },\n    dist: {\n      src: '*.css'\n    }\n  }\n});\n```\n\n## Options\n\n### compliance\n\nType: `String`  \nDefault: `\"AA\"`\n\nThe `compliance` option specifies the WCAG compliance the CSS will be evaluated\nagainst.\n\n### wcag-params\n\nType: `CSS Comment`\n\nThe `wcag-params` specifies additional font size, font weight, background, and\nforeground information about the rule.\n\n[npm-url]: https://www.npmjs.com/package/postcss-wcag-contrast\n[npm-img]: https://img.shields.io/npm/v/postcss-wcag-contrast.svg\n[cli-url]: https://travis-ci.org/jonathantneal/postcss-wcag-contrast\n[cli-img]: https://img.shields.io/travis/jonathantneal/postcss-wcag-contrast.svg\n[win-url]: https://ci.appveyor.com/project/jonathantneal/postcss-wcag-contrast\n[win-img]: https://img.shields.io/appveyor/ci/jonathantneal/postcss-wcag-contrast.svg\n[git-url]: https://gitter.im/postcss/postcss\n[git-img]: https://img.shields.io/badge/chat-gitter-blue.svg\n\n[WCAG Contrast]: https://github.com/jonathantneal/postcss-wcag-contrast\n[PostCSS]: https://github.com/postcss/postcss\n[Gulp PostCSS]: https://github.com/postcss/gulp-postcss\n[Grunt PostCSS]: https://github.com/nDmitry/grunt-postcss\n\n[color contrast compliance]: https://www.w3.org/TR/WCAG20/#visual-audio-contrast-contrast\n[Web Content Accessibility Guidelines (WCAG) 2.0]: https://www.w3.org/TR/WCAG20/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsstools%2Fpostcss-wcag-contrast","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcsstools%2Fpostcss-wcag-contrast","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsstools%2Fpostcss-wcag-contrast/lists"}