# @sika7/postcss-whitelist-sanitize

> PostCSS plugin this postcss plugin whitelist filter. sanitize leaving the allowed properties and values.

Latest version **1.0.0** (published 2021-11-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install @sika7/postcss-whitelist-sanitize
pnpm add @sika7/postcss-whitelist-sanitize
yarn add @sika7/postcss-whitelist-sanitize
bun add @sika7/postcss-whitelist-sanitize
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2021-11-29 |
| First published | 2021-11-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=12.0.0 |
| Dependencies | 1 |
| Unpacked size | 5.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | sika7 |
| Maintainers | sika7 |
| Keywords | postcss, css, postcss-plugin, postcss-whitelist-sanitize |

## Links

- npm: https://www.npmjs.com/package/@sika7/postcss-whitelist-sanitize
- Repository: https://github.com/sika7/postcss-whitelist-sanitize
- Homepage: https://github.com/sika7/postcss-whitelist-sanitize#readme
- Issues: https://github.com/sika7/postcss-whitelist-sanitize/issues
- npm.io page: https://npm.io/package/@sika7/postcss-whitelist-sanitize

## Dependencies (1)

- [css-values](https://npm.io/package/css-values.md) ^0.1.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

- 1.0.0 (latest) — 2021-11-29

## README

# postcss-whitelist-sanitize

[PostCSS] plugin this postcss plugin whitelist filter. sanitize leaving the allowed properties and values..

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

```css
.foo {
  a: #eee; // <= remove unknown property.
  background-color: hoge; // <= remove unknown value.
  position: fixed; // <= remove not allowed property.
  color: #eee;
}
```

```css
.foo {
  color: #eee;
}
```

## Usage

**Step 1:** Install plugin:

```sh
npm install --save postcss postcss-whitelist-sanitize
```

**Step 2:** allow property config.

```js
const opts = {
  allowPropertys: ["background-color", "color"], // required
  validationCheck: true,
  allowPropertyCheck: true,
}
postcss([postcssWhitelistSanitize(opts)]).process()
```

## config

default config.
```js
{
  allowPropertys: [], // all not allow propertys.
  validationCheck: true, // default true.
  allowPropertyCheck: true, // default true.
}
```

| setting            | description                                                                                                       | default | example                | 
| ------------------ | ----------------------------------------------------------------------------------------------------------------- | ------- | ---------------------- | 
| allowPropertys     | setting a allow propertys.                                                                                        | []      | ["color","text-align"] | 
| validationCheck    | true is remove validation error property and value. General w3c style Guideline applies. Using ben-eb/css-values module. | true    |                 | 
| allowPropertyCheck | true is remove not allow property. Using allowPropertys.                                                          | true    |                        |

[official docs]: https://github.com/postcss/postcss#usage

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