|
1 | 1 | # PostCSS Purgecss
|
2 |
| -[](https://travis-ci.org/FullHuman/postcss-purgecss) |
3 |
| -[]() |
4 |
| -[](https://david-dm.org/fullhuman/postcss-purgecss) |
5 |
| -[](https://david-dm.org/fullhuman/postcss-purgecss?type=dev) |
6 |
| -[](https://www.codacy.com/app/FullHuman/postcss-purgecss?utm_source=github.com&utm_medium=referral&utm_content=FullHuman/postcss-purgecss&utm_campaign=Badge_Grade) |
7 |
| -[](https://www.codacy.com/app/FullHuman/postcss-purgecss?utm_source=github.com&utm_medium=referral&utm_content=FullHuman/postcss-purgecss&utm_campaign=Badge_Coverage) |
8 |
| -[](https://github.com/prettier/prettier) |
9 |
| -[](https://www.npmjs.com/package/@fullhuman/postcss-purgecss) |
10 |
| -[]() [](https://greenkeeper.io/) |
11 | 2 |
|
12 |
| -[PostCSS] plugin for PurgeCSS. |
13 |
| - |
14 |
| -[PostCSS]: https://github.com/postcss/postcss |
15 |
| - |
16 |
| -## Installation |
| 3 | +The contents of this repository were moved into the |
| 4 | +[PurgeCSS](https://github.com/FullHuman/purgecss) repository. The source code can be |
| 5 | +found in [packages/postcss-purgecss](https://github.com/FullHuman/purgecss/tree/master/packages/postcss-purgecss). |
17 | 6 |
|
18 | 7 | ```
|
19 | 8 | npm i -D @fullhuman/postcss-purgecss
|
20 | 9 | ```
|
21 |
| - |
22 |
| -## Usage |
23 |
| - |
24 |
| -```js |
25 |
| -const purgecss = require('@fullhuman/postcss-purgecss') |
26 |
| -postcss([ |
27 |
| - purgecss({ |
28 |
| - content: ['./src/**/*.html'] |
29 |
| - }) |
30 |
| -]) |
31 |
| -``` |
32 |
| - |
33 |
| -See [PostCSS] docs for examples for your environment. |
34 |
| - |
35 |
| -## Options |
36 |
| - |
37 |
| -All of the options of purgecss are available to use with the plugins. |
38 |
| -You will find below the main options available. For the complete list, go to the [purgecss documentation website](https://www.purgecss.com/configuration.html#options). |
39 |
| - |
40 |
| -### `content` (**required**) |
41 |
| -Type: `string | Object` |
42 |
| - |
43 |
| -You can specify content that should be analyzed by Purgecss with an array of filenames or globs. The files can be HTML, Pug, Blade, etc. |
44 |
| - |
45 |
| -### `extractors` |
46 |
| -Type: `Array<Object>` |
47 |
| - |
48 |
| -Purgecss can be adapted to suit your needs. If you notice a lot of unused CSS is not being removed, you might want to use a custom extractor. |
49 |
| -More information about extractors [here](https://www.purgecss.com/extractors.html). |
50 |
| - |
51 |
| -### `whitelist` |
52 |
| -Type: `Array<string>` |
53 |
| - |
54 |
| -You can whitelist selectors to stop Purgecss from removing them from your CSS. This can be accomplished with the options whitelist and whitelistPatterns. |
55 |
| - |
56 |
| -### `whitelistPatterns` |
57 |
| -Type: `Array<RegExp>` |
58 |
| - |
59 |
| -You can whitelist selectors based on a regular expression with whitelistPatterns. |
60 |
| - |
61 |
| -### `rejected` |
62 |
| -Type: `boolean` |
63 |
| -Default value: `false` |
64 |
| - |
65 |
| -If true, purged selectors will be captured and rendered as PostCSS messages. |
66 |
| -Use with a PostCSS reporter plugin like [`postcss-reporter`](https://github.com/postcss/postcss-reporter) |
67 |
| -to print the purged selectors to the console as they are processed. |
68 |
| - |
69 |
| -### `keyframes` |
70 |
| -Type: `boolean` |
71 |
| -Default value: `false` |
72 |
| - |
73 |
| -If you are using a CSS animation library such as animate.css, you can remove unused keyframes by setting the keyframes option to true. |
74 |
| - |
75 |
| -#### `fontFace` |
76 |
| -Type: `boolean` |
77 |
| -Default value: `false` |
78 |
| - |
79 |
| -If there are any unused @font-face rules in your css, you can remove them by setting the fontFace option to true. |
80 |
| - |
81 |
| -## Contributing |
82 |
| - |
83 |
| -Please read [CONTRIBUTING.md](./CONTRIBUTING.md) for details on our code of |
84 |
| -conduct, and the process for submitting pull requests to us. |
85 |
| - |
86 |
| -## Versioning |
87 |
| - |
88 |
| -postcss-purgecss use [SemVer](http://semver.org/) for versioning. |
89 |
| - |
90 |
| -## License |
91 |
| - |
92 |
| -This project is licensed under the MIT License - see the [LICENSE](LICENSE) file |
93 |
| -for details. |
0 commit comments