# stylelint-gamut

> Stylelint plugin for working with different color spaces

Latest version **2.0.2** (published 2026-11-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install stylelint-gamut
pnpm add stylelint-gamut
yarn add stylelint-gamut
bun add stylelint-gamut
```

## Health

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

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

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 2.0.2 |
| Published | 2026-11-06 |
| First published | 2022-08-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=20.19.0 |
| Dependencies | 1 |
| Unpacked size | 8.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 53 |
| Author | Fedya Petrakov |
| Maintainers | fpetrakov |
| Keywords | stylelint, stylelint-plugin, gamut, lch, oklch, lab, oklab |

## Links

- npm: https://www.npmjs.com/package/stylelint-gamut
- Repository: https://github.com/fpetrakov/stylelint-gamut
- Homepage: https://github.com/fpetrakov/stylelint-gamut#readme
- Issues: https://github.com/fpetrakov/stylelint-gamut/issues
- npm.io page: https://npm.io/package/stylelint-gamut

## Dependencies (1)

- [colorjs.io](https://npm.io/package/colorjs.io.md) ^0.6.1

## Alternatives

- [eslint-plugin-sonarjs](https://npm.io/package/eslint-plugin-sonarjs.md) — 2.9M weekly downloads
- [eslint-config-expo](https://npm.io/package/eslint-config-expo.md) — 1.5M weekly downloads
- [@matter/protocol](https://npm.io/package/@matter/protocol.md) — 63.5K weekly downloads
- [@eventcatalog/linter](https://npm.io/package/@eventcatalog/linter.md) — 24.8K weekly downloads
- [@pandacss/eslint-plugin](https://npm.io/package/@pandacss/eslint-plugin.md) — 18.7K weekly downloads

## Recent versions

- 2.0.2 (latest) — 2026-11-06
- 2.0.1 — 2026-05-10
- 2.0.0 — 2026-02-16
- 1.3.4 — 2023-12-08
- 1.3.3 — 2023-06-17
- 1.3.2 — 2023-06-14
- 1.3.1 — 2023-02-09
- 1.3.0 — 2022-09-06
- 1.2.9 — 2022-09-02
- 1.2.8 — 2022-08-25
- 1.2.7 — 2022-08-24
- 1.2.6 — 2022-08-22
- 1.2.5 — 2022-08-22
- 1.2.4 — 2022-08-20
- 1.2.3 — 2022-08-19
- … 13 more at https://npm.io/package/stylelint-gamut/versions

## README

# <img src="./logo/logo.png" width="100" height="100">

[![npm version][npm-version-img]][npm] [![npm downloads last month][npm-downloads-img]][npm]

**stylelint-gamut** is a [Stylelint] plugin that helps you to work with different color spaces.

# Rules

- [`color-no-out-gamut-range`](./src/README.md): Throw warning if color goes out of sRGB color space and is not wrapped in `@media (color-gamut: p3) {}` or `@media (color-gamut: rec2020) {}`.

# Requirements

- **node version ≥ 20.0.0**
- **Stylelint version ≥ 14.0.0**.

# Installation

1. If you haven't, install [Stylelint]:

```
npm install stylelint stylelint-config-standard --save-dev
```

2.  Install `stylelint-gamut`:

```
npm install stylelint-gamut --save-dev
```

3. Add `stylelint-gamut` to your Stylelint config `plugins` array, then add rules you need to the rules list. All rules from `stylelint-gamut` need to be namespaced with `gamut`.

```json
{
  "plugins": ["stylelint-gamut"],
  "rules": {
    "gamut/color-no-out-gamut-range": true
  }
}
```

# More

It is already used by the creator of [PostCSS] [Andrey Sitnik].

Read more about color spaces in css:

- [OKLCH in CSS: why we moved from RGB and HSL](https://evilmartians.com/chronicles/oklch-in-css-why-quit-rgb-hsl)
- [LCH colors in CSS: what, why, and how?](https://lea.verou.me/2020/04/lch-colors-in-css-what-why-and-how/)
- [A Guide To Modern CSS Colors](https://www.smashingmagazine.com/2021/11/guide-modern-css-colors/)
- [Better dynamic themes in Tailwind with OKLCH color magic](https://evilmartians.com/chronicles/better-dynamic-themes-in-tailwind-with-oklch-color-magic)

[Stylelint]: https://stylelint.io/
[npm-version-img]: https://img.shields.io/npm/v/stylelint-gamut.svg
[npm-downloads-img]: https://img.shields.io/npm/dm/stylelint-gamut.svg
[npm]: https://www.npmjs.com/package/stylelint-gamut
[PostCSS]: https://github.com/postcss/postcss
[Andrey Sitnik]: https://github.com/ai

---
_Source: https://npm.io/package/stylelint-gamut · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
