# @csstools/postcss-contrast-color-function

> Dynamically specify a text color with adequate contrast

Latest version **3.0.12** (published 2026-09-13) · MIT-0 license · 0 weekly downloads

## Install

```sh
npm install @csstools/postcss-contrast-color-function
pnpm add @csstools/postcss-contrast-color-function
yarn add @csstools/postcss-contrast-color-function
bun add @csstools/postcss-contrast-color-function
```

## Health

**Score 60/100 (C)** — status: active.

Positive: esm support; no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 3.0.12 |
| Published | 2026-09-13 |
| First published | 2024-03-31 |
| Weekly downloads | 0 |
| License | MIT-0 |
| TypeScript types | none |
| Module format | ESM |
| Node | >=20.19.0 |
| Dependencies | 5 |
| Unpacked size | 6.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1051 |
| Maintainers | jonathantneal, alaguna, romainmenke |
| Keywords | contrast, contrast-color, css, postcss-plugin, wcag |

## Links

- npm: https://www.npmjs.com/package/@csstools/postcss-contrast-color-function
- Repository: https://github.com/csstools/postcss-plugins
- Homepage: https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-contrast-color-function#readme
- Issues: https://github.com/csstools/postcss-plugins/issues
- Funding: https://github.com/sponsors/csstools
- npm.io page: https://npm.io/package/@csstools/postcss-contrast-color-function

## Dependencies (5)

- [@csstools/utilities](https://npm.io/package/@csstools/utilities.md) ^3.0.0
- [@csstools/css-tokenizer](https://npm.io/package/@csstools/css-tokenizer.md) ^4.0.0
- [@csstools/css-color-parser](https://npm.io/package/@csstools/css-color-parser.md) ^4.2.3
- [@csstools/css-parser-algorithms](https://npm.io/package/@csstools/css-parser-algorithms.md) ^4.0.0
- [@csstools/postcss-progressive-custom-properties](https://npm.io/package/@csstools/postcss-progressive-custom-properties.md) ^5.1.3

## Alternatives

- [style-dictionary](https://npm.io/package/style-dictionary.md) — 2.0M weekly downloads
- [postcss-merge-idents](https://npm.io/package/postcss-merge-idents.md) — 1.7M weekly downloads
- [@fontsource/noto-sans](https://npm.io/package/@fontsource/noto-sans.md) — 93.0K weekly downloads
- [uglifycss](https://npm.io/package/uglifycss.md) — 71.6K weekly downloads
- [mat4-interpolate](https://npm.io/package/mat4-interpolate.md) — 23.3K weekly downloads

## Recent versions

- 3.0.12 (latest) — 2026-09-13
- 3.0.11 — 2026-09-06
- 3.0.10 — 2026-08-31
- 3.0.9 — 2026-08-25
- 3.0.8 — 2026-08-15
- 3.0.7 — 2026-07-22
- 3.0.6 — 2026-06-28
- 3.0.5 — 2026-06-14
- 3.0.4 — 2026-05-13
- 3.0.3 — 2026-04-12
- 3.0.2 — 2026-02-21
- 3.0.1 — 2026-01-25
- 3.0.0 — 2026-01-14
- 2.0.12 — 2025-09-21
- 2.0.11 — 2025-08-22
- … 18 more at https://npm.io/package/@csstools/postcss-contrast-color-function/versions

## README

# PostCSS Plugins [<img src="https://postcss.github.io/postcss/logo.svg" alt="" width="90" height="90" align="right">][postcss]

[<img alt="build status" src="https://github.com/csstools/postcss-plugins/actions/workflows/test.yml/badge.svg?branch=main" height="20">][ci-url]
[<img alt="Discord" src="https://img.shields.io/discord/853978108758851604?color=5865F2&label=Discord&logo=discord&logoColor=white">][discord]

We are happy you're here!

This repository contains plugins, plugin-packs, utilities, CLI tools, ... to help you do more with CSS.

## PostCSS Preset Env

Read more about [PostCSS Preset Env](https://github.com/csstools/postcss-plugins/tree/main/plugin-packs/postcss-preset-env#readme) or jump right in :

- Install `postcss-preset-env` from npm.
- Add `postcss-preset-env` to your configuration:

```js
const postcssPresetEnv = require('postcss-preset-env');

const yourConfig = {
	plugins: [
		/* other plugins */
		/* remove autoprefixer if you had it here, it's part of postcss-preset-env */
		postcssPresetEnv({
			/* pluginOptions */
			features: {},
		})
	]
}
```

## Overview

- [packages](https://github.com/csstools/postcss-plugins/tree/main/packages)
	- css tokenizers and parsers
	- common utilities
- [PostCSS plugins](https://github.com/csstools/postcss-plugins/tree/main/plugins)
- [PostCSS Preset Env](https://github.com/csstools/postcss-plugins/tree/main/plugin-packs/postcss-preset-env)
- [Stylelint plugins](https://github.com/csstools/postcss-plugins/tree/main/plugins-stylelint)
- [cli's](https://github.com/csstools/postcss-plugins/tree/main/cli)
- [sites](https://github.com/csstools/postcss-plugins/tree/main/sites)
- [PostCSS recipes](https://github.com/csstools/postcss-plugins/tree/main/postcss-recipes)

## Our current focus

### Standard CSS transforms

We're trying to bring every reasonable CSS Spec into all the browsers. 

First we keep track of new features through the [CSSDB] (see the [repo][CSSDB Repo]). Then we do our best to create a [PostCSS] plugin that can convert that new syntax/function/rules so every browser can understand it. 

While it's not always possible we're enabling over 50 features with these plugins!

### Developer experience

We want it to be easier for you to be effective at writing CSS.  
From time to time we will publish plugins that aren't related to a standard CSS spec but that we think will help developers.

## Contributing

Thanks for being willing to contribute! Please read our [contributing guide]!

## Acknowledgements

We could not do this work without the contributions of the community.  
We appreciate all of you!

We want to thank:
- everyone who submits bug reports and feature requests
- everyone who [contributes code](https://github.com/csstools/postcss-plugins/graphs/contributors)
- everyone who contributes financially:
  - [Open Collective](https://opencollective.com/csstools)
  - [GitHub Sponsors](https://github.com/sponsors/csstools)
  - [Thanks.dev](https://thanks.dev)
  - [Stackaid](https://www.stackaid.us)

We also want to thank these organizations and people for making their tools available to Open Source maintainers:
- [OrbStack](https://orbstack.dev)
- [GitHub Copilot](https://github.com/features/copilot)


[ci-url]: https://github.com/csstools/postcss-plugins/actions/workflows/test.yml?query=workflow/test
[discord]: https://discord.gg/bUadyRwkJS
[PostCSS]: https://github.com/postcss/postcss
[contributing guide]: https://github.com/csstools/postcss-plugins/blob/main/CONTRIBUTING.md
[CSSDB]: https://cssdb.org/
[CSSDB Repo]: https://github.com/csstools/cssdb

---
_Source: https://npm.io/package/@csstools/postcss-contrast-color-function · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
