# css-optimization

> This tool uses puppeteer's coverage feature to output an optimized CSS file.

Latest version **1.7.2** (published 2020-03-07) · apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install css-optimization
pnpm add css-optimization
yarn add css-optimization
bun add css-optimization
```

Provides the command `css-optimization`.

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.7.2 |
| Published | 2020-03-07 |
| First published | 2019-09-17 |
| Weekly downloads | 0 |
| License | apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 13 |
| Unpacked size | 137.7 KB |
| Known vulnerabilities | 0 (+5 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 42 |
| Author | toshi1127 |
| Maintainers | toshi1127 |
| Keywords | puppeteer, pupperium, css, cli |

## Links

- npm: https://www.npmjs.com/package/css-optimization
- Repository: https://github.com/toshi1127/css-optimization
- Homepage: https://github.com/toshi1127/css-optimization#readme
- Issues: https://github.com/toshi1127/css-optimization/issues
- npm.io page: https://npm.io/package/css-optimization

## Dependencies (13)

- [debug](https://npm.io/package/debug.md) ^4.1.1
- [faker](https://npm.io/package/faker.md) ^4.1.0
- [immer](https://npm.io/package/immer.md) ^4.0.0
- [pretty](https://npm.io/package/pretty.md) ^2.0.0
- [js-yaml](https://npm.io/package/js-yaml.md) ^3.13.1
- [postcss](https://npm.io/package/postcss.md) ^7.0.18
- [randexp](https://npm.io/package/randexp.md) ^0.5.3
- [commander](https://npm.io/package/commander.md) ^3.0.1
- [puppeteer](https://npm.io/package/puppeteer.md) ^1.20.0
- [handlebars](https://npm.io/package/handlebars.md) ^4.2.0
- [p-iteration](https://npm.io/package/p-iteration.md) ^1.1.8
- [recursive-readdir](https://npm.io/package/recursive-readdir.md) ^2.2.2
- [source-map-support](https://npm.io/package/source-map-support.md) ^0.5.13

## 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.7.2 (latest) — 2020-03-07
- 1.5.1 — 2020-03-07
- 1.7.1 — 2019-12-20
- 1.7.0 — 2019-12-20
- 1.6.0 — 2019-12-19
- 1.5.0 — 2019-12-19
- 1.4.0 — 2019-12-19
- 1.3.0 — 2019-11-19
- 1.2.0 — 2019-11-19
- 1.1.0 — 2019-11-19
- 1.0.7 — 2019-09-17
- 1.0.6 — 2019-09-17
- 1.0.5 — 2019-09-17
- 1.0.4 — 2019-09-17
- 1.0.3 — 2019-09-17
- … 3 more at https://npm.io/package/css-optimization/versions

## README

# css-optimization

This tool uses puppeteer's coverage feature to output an optimized CSS file.

As a feature of the tool, by using [pupperium](https://github.com/akito0107/pupperium), user can operate [puppeteer](https://github.com/GoogleChrome/puppeteer) with the yaml file.

Media query and font-face, etc. are not deleted because PostCSS AST node is used.

### Installing
```
$ npm install -g css-optimization
```

### How to use
```
$ css-optimization -p <caseDir> -i <imgDir> -c <cssDir>
```

### Options
```
$ css-optimization --help
Usage: css-optimization [options]

Options:
  -V, --version                   output the version number
  -p, --path <caseDir>            cases root dir
  -i, --image-dir <imgDir>        screehshots dir
  -c, --css-dir <cssDir>          optimize css dir
  -h, --disable-headless          disable headless mode
  -h, --help                      output usage information
```

### example: case file
```
name: demo
url: 'http://example.com/'
userAgent: 'bot'

steps:
  - action:
      type: hover
      selector: '.fuga'
  - action:
      type: click
      selector: '.hoge'
  - action:
      type: wait
      duration: 500
  - action:
      type: select
      selector: '.fuga'
  - action:
      type: focus
      selector: '.fuga'
  - action:
      type: screenshot
      name: 'demo'
```

### Demo
```
$ git clone https://github.com/toshi1127/css-optimization.git
$ cd cli
$ npm install
$ npm run build
$ npm run start:demo
```

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