# postcss-scrollbar

> PostCSS plugin enabling custom scrollbars

Latest version **0.5.1** (published 2022-06-21) · Unlicense license · 0 weekly downloads

## Install

```sh
npm install postcss-scrollbar
pnpm add postcss-scrollbar
yarn add postcss-scrollbar
bun add postcss-scrollbar
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.5.1 |
| Published | 2022-06-21 |
| First published | 2018-12-20 |
| Weekly downloads | 0 |
| License | Unlicense |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 14.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 75 |
| Author | Pascal Duez |
| Maintainers | pascalduez |
| Keywords | css, scrollbar, postcss, postcss-plugin |

## Links

- npm: https://www.npmjs.com/package/postcss-scrollbar
- Repository: https://github.com/pascalduez/postcss-scrollbar
- Issues: https://github.com/pascalduez/postcss-scrollbar/issues
- npm.io page: https://npm.io/package/postcss-scrollbar

## Dependencies (2)

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

## 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.1 (latest) — 2022-06-21
- 0.5.0 — 2022-03-01
- 0.4.0 — 2022-02-25
- 0.3.0 — 2019-01-27
- 0.2.1 — 2019-01-12
- 0.2.0 — 2018-12-27
- 0.1.0 — 2018-12-20

## README

# postcss-scrollbar

[![npm version][npm-image]][npm-url]
[![CI Status][ci-image]][ci-url]
[![Coverage Status][codecov-image]][codecov-url]

> [PostCSS] plugin enabling custom scrollbars

Spec : https://drafts.csswg.org/css-scrollbars-1  
Browser support: https://caniuse.com/#feat=css-scrollbar  
Docs: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Scrollbars

## Installation

```
npm install postcss postcss-scrollbar --save-dev
```

or

```
yarn add postcss postcss-scrollbar --save-dev
```

## Usage

```js
const fs = require('fs');
const postcss = require('postcss');
const scrollbar = require('postcss-scrollbar');

let input = fs.readFileSync('input.css', 'utf8');

postcss()
  .use(scrollbar)
  .process(input)
  .then(result => {
    fs.writeFileSync('output.css', result.css);
  });
```

## Examples

```css
/* input */
.scrollable {
  scrollbar-color: rebeccapurple green;
  scrollbar-width: thin;
}
```

```css
/* output */
.scrollable::-webkit-scrollbar-thumb {
  background-color: rebeccapurple;
}
.scrollable::-webkit-scrollbar-track {
  background-color: green;
}
.scrollable::-webkit-scrollbar-corner {
  background-color: green;
}
.scrollable::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.scrollable {
  -ms-overflow-style: auto;
  scrollbar-color: rebeccapurple green;
  scrollbar-width: thin;
}
```

```css
/* input */
.scrollable {
  scrollbar-width: none;
}
```

```css
/* output */
.scrollable::-webkit-scrollbar {
  width: 0;
  height: 0;
}
.scrollable {
  -ms-overflow-style: none;
  scrollbar-width: none;
}
```

## options

### `width`

type: `String`  
default: `8px`  
Allows for setting the webkit fallbacks `width` and `height`.

### `edgeAutohide`

type: `Boolean`  
default: `false`  
Allows for setting the scrollbar behaviour for the Edge Browser.  
`-ms-overflow-style: -ms-autohiding-scrollbar;`  
Edge doesn't support scrollbar styling.  
See https://developer.mozilla.org/fr/docs/Web/CSS/-ms-overflow-style

## Credits

- [Pascal Duez](https://github.com/pascalduez)

## Licence

postcss-scrollbar is [unlicensed](http://unlicense.org/).

[postcss]: https://github.com/postcss/postcss
[npm-url]: https://www.npmjs.org/package/postcss-scrollbar
[npm-image]: http://img.shields.io/npm/v/postcss-scrollbar.svg?style=flat-square
[ci-url]: https://github.com/pascalduez/postcss-scrollbar/actions/workflows/ci.yml
[ci-image]: https://img.shields.io/github/workflow/status/pascalduez/postcss-scrollbar/CI?style=flat-square
[codecov-url]: https://codecov.io/gh/pascalduez/postcss-scrollbar
[codecov-image]: https://img.shields.io/codecov/c/github/pascalduez/postcss-scrollbar.svg?style=flat-square
[license-image]: http://img.shields.io/npm/l/postcss-scrollbar.svg?style=flat-square
[license-url]: UNLICENSE

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