# postcss-overflow-clip

> PostCSS plugin that adds `overvlow: clip` whenever `overflow: hidden` is used and vice versa

Latest version **0.5.4** (published 2025-11-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install postcss-overflow-clip
pnpm add postcss-overflow-clip
yarn add postcss-overflow-clip
bun add postcss-overflow-clip
```

## Health

**Score 50/100 (C)** — status: stable.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.5.4 |
| Published | 2025-11-21 |
| First published | 2021-05-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Node | >=14.0.0 |
| Dependencies | 1 |
| Unpacked size | 138.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Carlos Jeurissen |
| Maintainers | hypnosphi, carlosjeurissen |
| Keywords | postcss, css, postcss-plugin, overflow |

## Links

- npm: https://www.npmjs.com/package/postcss-overflow-clip
- Repository: https://github.com/Hypnosphi/postcss-overflow-clip
- npm.io page: https://npm.io/package/postcss-overflow-clip

## Dependencies (1)

- [postcss-value-parser](https://npm.io/package/postcss-value-parser.md) ^4.2.0

## 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

- 0.5.4 (latest) — 2025-11-21
- 0.5.3 — 2025-09-11
- 0.5.2 — 2025-06-14
- 0.5.1 — 2024-12-10
- 0.5.0 — 2024-07-20
- 0.4.2 — 2024-06-10
- 0.4.1 — 2024-02-16
- 0.4.0 — 2024-02-13
- 0.3.2 — 2024-02-12
- 0.3.1 — 2024-02-09
- 0.3.0 — 2024-01-17
- 0.2.9 — 2023-12-12
- 0.2.7 — 2023-09-29
- 0.2.6 — 2023-07-19
- 0.2.5 — 2023-06-29
- … 6 more at https://npm.io/package/postcss-overflow-clip/versions

## README

# PostCSS Overflow Clip

[PostCSS] plugin that adds [`overflow: clip`](https://developer.chrome.com/blog/new-in-chrome-90/#overflow-clip) whenever `overflow: hidden` is used.

If you want fallbacks for `overflow: clip`, please use https://www.npmjs.com/package/postcss-overflow-fallbacks

[PostCSS]: https://github.com/postcss/postcss

```css
.foo {
    overflow-x: clip;
}

.bar {
    overflow: auto hidden;
    overflow-block: hidden;
}
```

becomes

```css
.foo {
    overflow-x: clip;
}

.bar {
    overflow: auto hidden;
    overflow: auto clip;
    overflow-block: hidden;
    overflow-block: clip;
}
```

With `preserve: false`:

```css
.foo {
    overflow-x: clip;
}

.bar {
    overflow: auto hidden;
    overflow-block: hidden;
}
```

becomes

```css
.foo {
    overflow-x: clip;
}

.bar {
    overflow: auto clip;
    overflow-block: clip;
}
```

## Usage

**Step 1:** Install plugin:

```sh
npm install --save-dev postcss postcss-overflow-clip
```

**Step 2:** Check you project for existed PostCSS config: `postcss.config.js`
in the project root, `"postcss"` section in `package.json`
or `postcss` in bundle config.

If you do not use PostCSS, add it according to [official docs]
and set this plugin in settings.

**Step 3:** Add the plugin to plugins list:

```diff
module.exports = {
  plugins: [
+   require('postcss-overflow-clip'),
  ]
}
```

## Options

**preserve (default: true)**
Fully replace `hidden` with `clip` without any fallback.

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