source: trip-planner-front/node_modules/cssnano-preset-default/README.md@ 6a3a178

Last change on this file since 6a3a178 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 9.9 KB
Line 
1# cssnano-preset-default
2
3> Safe defaults for cssnano which require minimal configuration.
4
5## Table of Contents
6
7- [Overview](#overview)
8
9- [Usage](#usage)
10
11 - [Install](#install)
12 - [Configuration](#configuration)
13
14- [Plugins](#plugins)
15
16 - [css-declaration-sorter (external)](#css-declaration-sorter-external)
17 - [cssnano-utils](#cssnano-utils)
18 - [postcss-calc (external)](#postcss-calc-external)
19 - [postcss-colormin](#postcss-colormin)
20 - [postcss-convert-values](#postcss-convert-values)
21 - [postcss-discard-comments](#postcss-discard-comments)
22 - [postcss-discard-duplicates](#postcss-discard-duplicates)
23 - [postcss-discard-empty](#postcss-discard-empty)
24 - [postcss-discard-overridden](#postcss-discard-overridden)
25 - [postcss-merge-longhand](#postcss-merge-longhand)
26 - [postcss-merge-rules](#postcss-merge-rules)
27 - [postcss-minify-font-values](#postcss-minify-font-values)
28 - [postcss-minify-gradients](#postcss-minify-gradients)
29 - [postcss-minify-params](#postcss-minify-params)
30 - [postcss-minify-selectors](#postcss-minify-selectors)
31 - [postcss-normalize-charset](#postcss-normalize-charset)
32 - [postcss-normalize-display-values](#postcss-normalize-display-values)
33 - [postcss-normalize-positions](#postcss-normalize-positions)
34 - [postcss-normalize-repeat-style](#postcss-normalize-repeat-style)
35 - [postcss-normalize-string](#postcss-normalize-string)
36 - [postcss-normalize-timing-functions](#postcss-normalize-timing-functions)
37 - [postcss-normalize-unicode](#postcss-normalize-unicode)
38 - [postcss-normalize-url](#postcss-normalize-url)
39 - [postcss-normalize-whitespace](#postcss-normalize-whitespace)
40 - [postcss-ordered-values](#postcss-ordered-values)
41 - [postcss-reduce-initial](#postcss-reduce-initial)
42 - [postcss-reduce-transforms](#postcss-reduce-transforms)
43 - [postcss-svgo](#postcss-svgo)
44 - [postcss-unique-selectors](#postcss-unique-selectors)
45
46- [Contributors](#contributors)
47
48- [License](#license)
49
50## Overview
51
52This default preset for cssnano only includes transforms that make no
53assumptions about your CSS other than what is passed in. In previous
54iterations of cssnano, assumptions were made about your CSS which caused
55output to look different in certain use cases, but not others. These
56transforms have been moved from the defaults to other presets, to make
57this preset require only minimal configuration.
58
59## Usage
60
61### Install
62
63Note that this preset comes bundled with cssnano _by default_, so you don't need to install it separately.
64
65### Configuration
66
67If you would like to use the default configuration, then you don't need to add anything to your `package.json`.
68
69But should you wish to customise this, you can pass an array with the second parameter as the options object to use. For example, to remove all comments:
70
71```diff
72 {
73 "name": "awesome-application",
74+ "cssnano": {
75+ "preset": [
76+ "default",
77+ {"discardComments": {"removeAll": true}}
78+ ]
79+ }
80 }
81```
82
83Depending on your usage, the JSON configuration might not work for you, such as in cases where you would like to use options with customisable function parameters. For this use case, we recommend a `cssnano.config.js` at the same location as your `package.json`. You can then load a preset and export it with your custom parameters:
84
85```js
86const defaultPreset = require('cssnano-preset-default');
87
88module.exports = defaultPreset({
89 discardComments: {
90 remove: (comment) => comment[0] === '@',
91 },
92});
93```
94
95Note that you may wish to publish your own preset to npm for reusability, should it differ a lot from this one. This is highly encouraged!
96
97## Plugins
98
99### [`css-declaration-sorter`](https://github.com/Siilwyn/css-declaration-sorter) (external)
100
101> Sorts CSS declarations fast and automatically in a certain order.
102
103This plugin is loaded with the following configuration:
104
105```js
106{
107 keepOverrides: true
108}
109```
110
111### [`cssnano-utils`](https://github.com/cssnano/cssnano/tree/master/packages/cssnano-utils)
112
113> Utility methods used by cssnano
114
115### [`postcss-calc`](https://github.com/postcss/postcss-calc) (external)
116
117> PostCSS plugin to reduce calc()
118
119This plugin is loaded with its default configuration.
120
121### [`postcss-colormin`](https://github.com/cssnano/cssnano/tree/master/packages/postcss-colormin)
122
123> Minify colors in your CSS files with PostCSS.
124
125This plugin is loaded with its default configuration.
126
127### [`postcss-convert-values`](https://github.com/cssnano/cssnano/tree/master/packages/postcss-convert-values)
128
129> Convert values with PostCSS (e.g. ms -> s)
130
131This plugin is loaded with the following configuration:
132
133```js
134{
135 length: false;
136}
137```
138
139### [`postcss-discard-comments`](https://github.com/cssnano/cssnano/tree/master/packages/postcss-discard-comments)
140
141> Discard comments in your CSS files with PostCSS.
142
143This plugin is loaded with its default configuration.
144
145### [`postcss-discard-duplicates`](https://github.com/cssnano/cssnano/tree/master/packages/postcss-discard-duplicates)
146
147> Discard duplicate rules in your CSS files with PostCSS.
148
149This plugin is loaded with its default configuration.
150
151### [`postcss-discard-empty`](https://github.com/cssnano/cssnano/tree/master/packages/postcss-discard-empty)
152
153> Discard empty rules and values with PostCSS.
154
155This plugin is loaded with its default configuration.
156
157### [`postcss-discard-overridden`](https://github.com/cssnano/cssnano/tree/master/packages/postcss-discard-overridden)
158
159> PostCSS plugin to discard overridden @keyframes or @counter-style.
160
161This plugin is loaded with its default configuration.
162
163### [`postcss-merge-longhand`](https://github.com/cssnano/cssnano/tree/master/packages/postcss-merge-longhand)
164
165> Merge longhand properties into shorthand with PostCSS.
166
167This plugin is loaded with its default configuration.
168
169### [`postcss-merge-rules`](https://github.com/cssnano/cssnano/tree/master/packages/postcss-merge-rules)
170
171> Merge CSS rules with PostCSS.
172
173This plugin is loaded with its default configuration.
174
175### [`postcss-minify-font-values`](https://github.com/cssnano/cssnano/tree/master/packages/postcss-minify-font-values)
176
177> Minify font declarations with PostCSS
178
179This plugin is loaded with its default configuration.
180
181### [`postcss-minify-gradients`](https://github.com/cssnano/cssnano/tree/master/packages/postcss-minify-gradients)
182
183> Minify gradient parameters with PostCSS.
184
185This plugin is loaded with its default configuration.
186
187### [`postcss-minify-params`](https://github.com/cssnano/cssnano/tree/master/packages/postcss-minify-params)
188
189> Minify at-rule params with PostCSS
190
191This plugin is loaded with its default configuration.
192
193### [`postcss-minify-selectors`](https://github.com/cssnano/cssnano/tree/master/packages/postcss-minify-selectors)
194
195> Minify selectors with PostCSS.
196
197This plugin is loaded with its default configuration.
198
199### [`postcss-normalize-charset`](https://github.com/cssnano/cssnano/tree/master/packages/postcss-normalize-charset)
200
201> Add necessary or remove extra charset with PostCSS
202
203This plugin is loaded with the following configuration:
204
205```js
206{
207 add: false;
208}
209```
210
211### [`postcss-normalize-display-values`](https://github.com/cssnano/cssnano/tree/master/packages/postcss-normalize-display-values)
212
213> Normalize multiple value display syntaxes into single values.
214
215This plugin is loaded with its default configuration.
216
217### [`postcss-normalize-positions`](https://github.com/cssnano/cssnano/tree/master/packages/postcss-normalize-positions)
218
219> Normalize keyword values for position into length values.
220
221This plugin is loaded with its default configuration.
222
223### [`postcss-normalize-repeat-style`](https://github.com/cssnano/cssnano/tree/master/packages/postcss-normalize-repeat-style)
224
225> Convert two value syntax for repeat-style into one value.
226
227This plugin is loaded with its default configuration.
228
229### [`postcss-normalize-string`](https://github.com/cssnano/cssnano/tree/master/packages/postcss-normalize-string)
230
231> Normalize wrapping quotes for CSS string literals.
232
233This plugin is loaded with its default configuration.
234
235### [`postcss-normalize-timing-functions`](https://github.com/cssnano/cssnano/tree/master/packages/postcss-normalize-timing-functions)
236
237> Normalize CSS animation/transition timing functions.
238
239This plugin is loaded with its default configuration.
240
241### [`postcss-normalize-unicode`](https://github.com/cssnano/cssnano/tree/master/packages/postcss-normalize-unicode)
242
243> Normalize unicode-range descriptors, and can convert to wildcard ranges.
244
245This plugin is loaded with its default configuration.
246
247### [`postcss-normalize-url`](https://github.com/cssnano/cssnano/tree/master/packages/postcss-normalize-url)
248
249> Normalize URLs with PostCSS
250
251This plugin is loaded with its default configuration.
252
253### [`postcss-normalize-whitespace`](https://github.com/cssnano/cssnano/tree/master/packages/postcss-normalize-whitespace)
254
255> Trim whitespace inside and around CSS rules & declarations.
256
257This plugin is loaded with its default configuration.
258
259### [`postcss-ordered-values`](https://github.com/cssnano/cssnano/tree/master/packages/postcss-ordered-values)
260
261> Ensure values are ordered consistently in your CSS.
262
263This plugin is loaded with its default configuration.
264
265### [`postcss-reduce-initial`](https://github.com/cssnano/cssnano/tree/master/packages/postcss-reduce-initial)
266
267> Reduce initial definitions to the actual initial value, where possible.
268
269This plugin is loaded with its default configuration.
270
271### [`postcss-reduce-transforms`](https://github.com/cssnano/cssnano/tree/master/packages/postcss-reduce-transforms)
272
273> Reduce transform functions with PostCSS.
274
275This plugin is loaded with its default configuration.
276
277### [`postcss-svgo`](https://github.com/cssnano/cssnano/tree/master/packages/postcss-svgo)
278
279> Optimise inline SVG with PostCSS.
280
281This plugin is loaded with its default configuration.
282
283### [`postcss-unique-selectors`](https://github.com/cssnano/cssnano/tree/master/packages/postcss-unique-selectors)
284
285> Ensure CSS selectors are unique.
286
287This plugin is loaded with its default configuration.
288
289## Contributors
290
291See [CONTRIBUTORS.md](https://github.com/cssnano/cssnano/blob/master/CONTRIBUTORS.md).
292
293## License
294
295MIT © [Ben Briggs](http://beneb.info)
Note: See TracBrowser for help on using the repository browser.