{"id":13759298,"url":"https://github.com/shiwaforce/postcss-high-contrast","last_synced_at":"2026-02-28T14:22:27.427Z","repository":{"id":7761867,"uuid":"42712900","full_name":"shiwaforce/postcss-high-contrast","owner":"shiwaforce","description":"Create high contrast version of your project with ease.","archived":false,"fork":false,"pushed_at":"2023-01-03T16:00:46.000Z","size":2125,"stargazers_count":112,"open_issues_count":14,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-10-12T04:37:11.920Z","etag":null,"topics":["accessibility","contrast","contrast-plugins","css","postcss","postcss-plugins"],"latest_commit_sha":null,"homepage":"https://github.com/shiwaforce/postcss-high-contrast","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shiwaforce.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-09-18T09:40:53.000Z","updated_at":"2025-07-22T20:12:51.000Z","dependencies_parsed_at":"2023-01-13T14:29:33.378Z","dependency_job_id":null,"html_url":"https://github.com/shiwaforce/postcss-high-contrast","commit_stats":null,"previous_names":["admdh/postcss-high-contrast"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/shiwaforce/postcss-high-contrast","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shiwaforce%2Fpostcss-high-contrast","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shiwaforce%2Fpostcss-high-contrast/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shiwaforce%2Fpostcss-high-contrast/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shiwaforce%2Fpostcss-high-contrast/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shiwaforce","download_url":"https://codeload.github.com/shiwaforce/postcss-high-contrast/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shiwaforce%2Fpostcss-high-contrast/sbom","scorecard":{"id":819761,"data":{"date":"2025-08-11","repo":{"name":"github.com/shiwaforce/postcss-high-contrast","commit":"7175e584802d2b5b1eb8c6c44de7de633a09f0fd"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2,"checks":[{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":2,"reason":"Found 6/25 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 11 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"33 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-6chw-6frg-f759","Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-ff7x-qrg7-qggm","Warn: Project is vulnerable to: GHSA-ww39-953v-wcq6","Warn: Project is vulnerable to: GHSA-pfrx-2q88-qq97","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-rc47-6667-2j5j","Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-px4h-xg32-q955","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-566m-qj78-rww5","Warn: Project is vulnerable to: GHSA-hwj9-h5mp-3pm3","Warn: Project is vulnerable to: GHSA-7fh5-64p2-3v2j","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-7p7h-4mm5-852v","Warn: Project is vulnerable to: GHSA-38fc-wpqx-33j7","Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-23T15:10:39.616Z","repository_id":7761867,"created_at":"2025-08-23T15:10:39.616Z","updated_at":"2025-08-23T15:10:39.616Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29937381,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-28T13:49:17.081Z","status":"ssl_error","status_checked_at":"2026-02-28T13:48:50.396Z","response_time":90,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["accessibility","contrast","contrast-plugins","css","postcss","postcss-plugins"],"created_at":"2024-08-03T13:00:50.412Z","updated_at":"2026-02-28T14:22:27.383Z","avatar_url":"https://github.com/shiwaforce.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/shiwaforce/postcss-high-contrast.svg?branch=master)](https://travis-ci.org/shiwaforce/postcss-high-contrast)\n# PostCSS High Contrast\n\u003cimg align=\"right\" width=\"108\" height=\"108\" title=\"Philosopher’s stone, logo of PostCSS\" src=\"http://postcss.github.io/postcss/logo.svg\" hspace=\"20\"\u003e\nPostCSS High Contrast is PostCSS plugin that helps automatically convert all colors to high contrast. This Plugin gives you ability to create high contrast version of your project with ease.\n\n## Why?\nAccessible websites are getting more popular. Some countries even pass laws obliging IT companies create high contrast versions of their projects. Creating high contrast version of your project due some reasons can be painful.\n\n\n## Live Example\n\u003cimg title=\"High Contras Example\" src=\"img/high-contrast-example-4.png\"\u003e\n\n\n## Basic Usage\n```js\npostcss([\n\trequire('postcss-high-contrast')({\n\t\taggressiveHC: true,\n\t\taggressiveHCDefaultSelectorList: ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'p', 'li', 'th', 'td'],\n\t\taggressiveHCCustomSelectorList: ['div', 'span'],\n\n\t\tcolorProps: ['color', 'fill'],\n\n\t\tbackgroundColor: '#000',\n\t\taltBgColor: '#fff',\n\n\t\ttextColor: '#fff',\n\n\t\tbuttonSelector: ['button'],\n\t\tbuttonColor: '#000',\n\t\tbuttonBackgroundColor: '#fcff3c',\n\t\tbuttonBorderColor: 'none',\n\t\t\n\t\tlinkSelectors:  ['a'],\n\t\tlinkColor: '#fcff3c',\n\t\tlinkHoverColor: '#fcff3c',\n\n\t\tborderColor: '#fff',\n\t\tdisableShadow: true,\n\t\t\n\t\tcustomSelectors: ['input'],\n\t\tcustomSelectorColor: '#fff',\n\t\tcustomSelectorBackgroundColor: '#000',\n\t\tcustomSelectorBorderdColor: '#fff',\n\t\t\n\t\tselectorsBlackList: ['textfield'],\n\n\t\timageFilter: 'invert(100%)',\n\t\timageSelectors: ['img'],\n\n\t\tremoveCSSProps: false,\n        CSSPropsWhiteList: ['background', 'background-color', 'color', 'border', 'border-top', 'border-bottom',\n            'border-left', 'border-right', 'border-color', 'border-top-color', 'border-right-color',\n            'border-bottom-color', 'border-left-color', 'box-shadow', 'filter', 'text-shadow', 'fill']\n\t})\n]);\n\n```\n## How It works?\n#### None Aggressive Mode\nPostCSS High Contrast plugin will find all colors and replace them to high contrast ones.\ninput.css:\n```css\nbody {\n\tbackground: #fff;\n\tcolor: #000;\n}\n\na {\n\tcolor: #0b39e1;\n}\n```\noutput.css:\n```css\nbody {\n\tbackground: #000;\n\tcolor: #fff;\n}\n\na {\n\tcolor: #fcff3c;\n}\n```\n#### Aggressive Mode\nIn addition to replacing colors to high contrast colors, there is \"Aggressive Mode\". \"Aggressive Mode\" (```aggressiveHC```) is enabled by default. If selector doesn't have ```color``` property it will automatically append it for increasing specificity and providing more accurate results.\ninput.css:\n```css\nh1 {\n\tfont-size: 48px;\n\tmargin: 0;\n\tpadding: 0 24px;\n\twidth: 100%;\n}\n\np {\n\tfont-size: 48px;\n\tmargin: 0 0 24px;\n}\n```\noutput.css:\n```css\nh1 {\n\tcolor: #fff;\n\tfont-size: 48px;\n\tmargin: 0;\n\tpadding: 0 24px;\n\twidth: 100%;\n}\n\np {\n\tcolor: #fff;\n\tfont-size: 48px;\n\tmargin: 0 0 24px;\n}\n```\nUse ```aggressiveHCDefaultSelectorList``` and ```aggressiveHCCustomSelectorList``` to define own lists of properties.\n\n#### Removing Unused CSS\nFor better css optimization there is an option to remove unused css.\ninput.css:\n ```css\n h1 {\n \tfont-size: 48px;\n \tmargin: 0;\n \tpadding: 0 24px;\n \twidth: 100%;\n }\n\n p {\n \tfont-size: 48px;\n \tmargin: 0 0 24px;\n }\n ```\n output.css:\n ```css\n h1 {\n \tcolor: #fff;\n }\n\n p {\n \tcolor: #fff;\n }\n ```\n For merging CSS selectors use CSS minifiers like [CSSNano](https://github.com/ben-eb/cssnano) or [CSSO](https://github.com/css/csso).\n If you are using PostCSS High Contrast Plugins with some other PostCSS Plugins like [PostCSS Increase Text Sizes](https://github.com/admdh/postcss-increase-text-sizes) you might need some other properties to remain. For this case there is ```CSSPropsWhiteList``` option that prevents from deleting css properties:\n ```\n CSSPropsWhiteList: ['background', 'background-color', 'color', 'border', 'border-top', 'border-bottom', 'border-left', 'border-right', 'border-color', 'border-top-color', 'border-right-color', 'border-bottom-color', 'border-left-color', 'box-shadow', 'filter', 'text-shadow']\n ```\n\n#### WARNING!\n```removeCSSProps``` also can remove css properies generated by PostCSS High Contrast. To Prevent this use ```CSSPropsWhiteList```!\n\n\n#### Appending to wepbage\nUsing this plugin it's better to generate new high contrast version of css file. Than it is very easy to add/append high contrast version css to a webpage using JavaScript.\nJQuery example:\n```js\nfunction appendHighContrastCss(){\n\tvar hc = '\u003clink rel=\"stylesheet\" href=\"/assets/css/high-contrast.css\" id=\"hccss\"/\u003e';\n\n\tif(!$('#highContrastCss').length ){\n\t\t$('head').append(hc);\n\t} else {\n\t\t$('#hccss').remove();\n\t}\n}\n\n$('a.high-contrast').click(loadHighContrastCSS);\n\tappendHighContrastCss();\n}\n```\nTip: use cookies to remember turned on high contrast css on different sessions and pages.\n\n\n\n## Options\n| Name                              | Default Value                                      | Description    |\n|:----------------------------------|:---------------------------------------------------|:---------------|\n| `aggressiveHC`                    | `true`                                             | Will append properties even if they do not exist |\n| `aggressiveHCDefaultSelectorList` | `['h1', 'h2', 'h3', 'h4', 'h5', 'h6','p', 'li', 'th', 'td']` | Default list of selectors for aggressive property append |\n| `aggressiveHCCustomSelectorList`  | `['span']`                                         | Custom list of selectors for aggressive property append |\n| `colorProps     `                 | `['color','fill']`                                 | List of Properties that will be considered for color changing |\n| `backgroundColor`                 | `#000`                                             | Backgound color |\n| `altBgColor`                      | `#fff`                                             | Alternative background color |\n| `textColor`                       | `#fff`                                             | Text color |\n| `buttonSelector`                  | `[button]`                                         | Button Selector |\n| `buttonColor`                     | `#000`                                             | Button color |\n| `buttonBackgroundColor`           | `#fcff3c`                                          | Button background color |\n| `buttonBorderColor`               | `none`                                             | Button border color |\n| `linkColor`                       | `#fcff3c`                                          | Link color |\n| `linkHoverBgColor`                | `#fff`                                             | Link hover bacground color |\n| `linkHoverColor`                  | `#000`                                             | Link hover color |\n| `borderColor`                     | `#fff`                                             | Border color |\n| `disableShadow`                   | `true`                                             | Disable shadow |\n| `imageFilter`                     | `false`/`invert(100%)`/`grayscale(100%)`/`contrast(200%)`     | Image Filter (disabled by default). `false` to disable. Any css filter option can be passed|\n| `imageSelectors`                  | `['img']`                                           | Default list of image selectors to apply `imageFilter`|\n| `removeCSSProps`                  | `false`                                             | This option will remove all unused CSS selectors or properties for better optimization. Use CSS minifiers like CSSNano or CSSO to merge selectors|\n| `CSSPropsWhiteList`               | `['background', 'background-color', 'color', 'border', 'border-top', 'border-bottom', 'border-left', 'border-right', 'border-color', 'border-top-color', 'border-right-color', 'border-bottom-color', 'border-left-color', 'box-shadow', 'filter', 'text-shadow']`       | CSS properties whitelist |\n\n\n## Used by\n[Magyar Posta](https://www.posta.hu)\n[Signal IDUNA](http://www.signal.hu)\n\n## Works great with:\n[PostCSS Increase Text Sizes](https://github.com/admdh/postcss-increase-text-sizes)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshiwaforce%2Fpostcss-high-contrast","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshiwaforce%2Fpostcss-high-contrast","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshiwaforce%2Fpostcss-high-contrast/lists"}