Lines Matching refs:to
17 According to [tests](http://goalsmashers.github.io/css-minification-benchmark/) it is one of the be…
40 * [How to optimize multiple files?](#how-to-optimize-multiple-files)
41 * [How to process remote `@import`s correctly?](#how-to-process-remote-imports-correctly)
42 …* [How to apply arbitrary transformations to CSS properties?](#how-to-apply-arbitrary-transformati…
43 * [How to specify a custom rounding precision?](#how-to-specify-a-custom-rounding-precision)
44 * [How to keep a CSS fragment intact?](#how-to-keep-a-css-fragment-intact)
45 * [How to preserve a comment block?](#how-to-preserve-a-comment-block)
46 * [How to rebase relative image URLs?](#how-to-rebase-relative-image-urls)
47 * [How to work with source maps?](#how-to-work-with-source-maps)
48 …* [How to apply level 1 & 2 optimizations at the same time?](#how-to-apply-level-1--2-optimization…
50 * [How to use clean-css with build tools?](#how-to-use-clean-css-with-build-tools)
51 * [How to use clean-css from web browser?](#how-to-use-clean-css-from-web-browser)
53 * [How to get started?](#how-to-get-started)
80 * API and CLI interfaces are split, so API stays in this repository while CLI moves to [clean-css-c…
84 * `roundingPrecision` applies to **all** units now, not only `px` as in 3.x;
85 * `processImport` and `processImportFrom` are merged into `inline` option which defaults to `local`…
88 * changes default Internet Explorer compatibility from 9+ to 10+, to revert the old default use `{ …
89 * renames `keepSpecialComments` to `specialComments`;
90 * moves `roundingPrecision` and `specialComments` to level 1 optimizations options, see examples;
91 * moves `mediaMerging`, `restructuring`, `semanticMerging`, and `shorthandCompacting` to level 2 op…
92 * renames `shorthandCompacting` option to `mergeIntoShorthands`;
93 * level 1 optimizations are the new default, up to 3.x it was level 2;
94 * `keepBreaks` option is replaced with `{ format: 'keep-breaks' }` to ease transition;
95 * `sourceMap` option has to be a boolean from now on - to specify an input source map pass it a 2nd…
102 * `inline: false` as an alias to `inline: ['none']`;
111 * removal of `optimizeFont` flag in level 1 optimizations due to new `font` shorthand optimizer;
115 …pawlowicz.github.io/clean-css) gets an improved settings panel with "reset to defaults", instant o…
124 …d on selector in `transform` callback, see [example](#how-to-apply-arbitrary-transformations-to-cs…
131 * `compatibility` - controls compatibility mode used; defaults to `ie10+`; see [compatibility modes…
133 * `format` - controls output CSS formatting; defaults to `false`; see [formatting options](#formatt…
134 * `inline` - controls `@import` inlining rules; defaults to `'local'`; see [inlining options](#inli…
136 … - controls number of milliseconds after which inlining a remote `@import` fails; defaults to 5000;
137 * `level` - controls optimization level used; defaults to `1`; see [optimization levels](#optimizat…
138 * `rebase` - controls URL rebasing; defaults to `true`;
139 …- controls a directory to which all URLs are rebased, most likely the directory under which the ou…
140 * `returnPromise` - controls whether `minify` method returns a Promise object or not; defaults to `…
141 * `sourceMap` - controls whether an output source map is built; defaults to `false`;
142 …rces` - controls embedding sources inside a source map's `sourcesContent` field; defaults to false.
153 Each of these modes is an alias to a [fine grained configuration](https://github.com/jakubpawlowicz…
203 …compatibility: 'ie9,-properties.merging' // sets compatibility to IE9 mode with disabled property …
213 var source = '@import url(http://example.com/path/to/stylesheet.css);';
257 breaks: { // controls where to insert breaks
258 …le: false, // controls if a line break comes after an at-rule; e.g. `@charset`; defaults to `false`
259 …: false, // controls if a line break comes after a block begins; e.g. `@media`; defaults to `false`
260 … afterBlockEnds: false, // controls if a line break comes after a block ends, defaults to `false`
261 afterComment: false, // controls if a line break comes after a comment; defaults to `false`
262 afterProperty: false, // controls if a line break comes after a property; defaults to `false`
263 … afterRuleBegins: false, // controls if a line break comes after a rule begins; defaults to `false`
264 afterRuleEnds: false, // controls if a line break comes after a rule ends; defaults to `false`
265 … beforeBlockEnds: false, // controls if a line break comes before a block ends; defaults to `false`
266 … betweenSelectors: false // controls if a line break comes between selectors; defaults to `false`
268 …n'` (aliased as `'windows'` and `'unix'` or `'crlf'` and `'lf'`); defaults to system one, so forme…
269 indentBy: 0, // controls number of characters to indent with; defaults to `0`
270 …indentWith: 'space', // controls a character to indent with, can be `'space'` or `'tab'`; defaults…
271 spaces: { // controls where to insert spaces
272 …n: false, // controls if spaces come around selector relations; e.g. `div > a`; defaults to `false`
273 …ns: false, // controls if a space comes before a block begins; e.g. `.block {`; defaults to `false`
274 …reValue: false // controls if a space comes before a value; e.g. `width: 1rem`; defaults to `false`
276 wrapAt: false // controls maximum line length; defaults to `false`
301 inline: false // disables all inlining (alias to `['none']`)
339 Level 0 optimizations simply means "no optimizations". Use it when you'd like to inline imports and…
343 … properties only, e.g. can remove units when not required, turn rgb colors to a shorter hex repres…
351 …cleanupCharsets: true, // controls `@charset` moving to the front of a stylesheet; defaults to `tr…
352 normalizeUrls: true, // controls URL normalization; defaults to `true`
353 optimizeBackground: true, // controls `background` property optimizations; defaults to `true`
354 … optimizeBorderRadius: true, // controls `border-radius` property optimizations; defaults to `true`
355 optimizeFilter: true, // controls `filter` property optimizations; defaults to `true`
356 optimizeFont: true, // controls `font` property optimizations; defaults to `true`
357 optimizeFontWeight: true, // controls `font-weight` property optimizations; defaults to `true`
358 optimizeOutline: true, // controls `outline` property optimizations; defaults to `true`
359 removeEmpty: true, // controls removing empty rules and nested blocks; defaults to `true`
360 removeNegativePaddings: true, // controls removing negative paddings; defaults to `true`
361 removeQuotes: true, // controls removing quotes when unnecessary; defaults to `true`
362 removeWhitespace: true, // controls removing unused whitespace; defaults to `true`
363 replaceMultipleZeros: true, // contols removing redundant zeros; defaults to `true`
364 … replaceTimeUnits: true, // controls replacing time units with shorter values; defaults to `true`
365 replaceZeroUnits: true, // controls replacing zero values with units; defaults to `true`
366 …ndingPrecision: false, // rounds pixel values to `N` decimal places; `false` disables rounding; de…
367 …'natural'` or `'standard'`, `'none'`, or false (the last two since 4.1.0); defaults to `'standard'`
368 … specialComments: 'all', // denotes a number of /*! ... */ comments preserved; defaults to `all`
369 …tidyAtRules: true, // controls at-rules (e.g. `@charset`, `@import`) optimizing; defaults to `true`
370 tidyBlockScopes: true, // controls block scopes (e.g. `@media`) optimizing; defaults to `true`
371 tidySelectors: true, // controls selectors optimizing; defaults to `true`,
372 …roperty: false, // controls removing trailing semicolons in rule; defaults to `false` - means remo…
373 …orm: function () {} // defines a callback for fine-grained property optimization; defaults to no-op
385 all: false, // set all values to `false`
404 mergeAdjacentRules: true, // controls adjacent rules merging; defaults to true
405 mergeIntoShorthands: true, // controls merging properties into shorthands; defaults to true
406 mergeMedia: true, // controls `@media` merging; defaults to true
407 mergeNonAdjacentRules: true, // controls non-adjacent rule merging; defaults to true
408 mergeSemantically: false, // controls semantic merging; defaults to false
409 …rrideProperties: true, // controls property overriding based on understandability; defaults to true
410 removeEmpty: true, // controls removing empty rules and nested blocks; defaults to `true`
411 reduceNonAdjacentRules: true, // controls non-adjacent rule reducing; defaults to true
412 removeDuplicateFontRules: true, // controls duplicate `@font-face` removing; defaults to true
413 removeDuplicateMediaBlocks: true, // controls duplicate `@media` removing; defaults to true
414 removeDuplicateRules: true, // controls duplicate rules removing; defaults to true
415 …removeUnusedAtRules: false, // controls unused at rule removing; defaults to false (available sinc…
416 restructureRules: false, // controls rule restructuring; defaults to false
417 …skipProperties: [] // controls which properties won't be optimized, defaults to `[]` which means a…
429 all: false, // sets all values to `false`
438 Once configured clean-css provides a `minify` method to optimize a given CSS, e.g.
454 …iginalSize - minifiedSize) / originalSize`, e.g. 0.25 if size is reduced from 100 bytes to 75 bytes
473 If you prefer clean-css to return a Promise object then you need to explicitely ask for it, e.g.
488 ## How to optimize multiple files?
493 new CleanCSS().minify(['path/to/file/one', 'path/to/file/two']);
498 'path/to/file/one': {
501 'path/to/file/two': {
509 {'path/to/file/one': {styles: 'contents of file one'}},
510 {'path/to/file/two': {styles: 'contents of file two'}}
514 Passing an array of hashes allows you to explicitly specify the order in which the input files are …
518 ## How to process remote `@import`s correctly?
520 In order to inline remote `@import` statements you need to provide a callback to minify method as f…
523 var source = '@import url(http://example.com/path/to/remote/styles);';
531 ## How to apply arbitrary transformations to CSS properties?
533 …s doesn't perform a particular property optimization, you can use `transform` callback to apply it:
536 var source = '.block{background-image:url(/path/to/image.png)}';
541 if (propertyName == 'background-image' && propertyValue.indexOf('/path/to') > -1) {
542 return propertyValue.replace('/path/to', '../valid/path/to');
549 console.log(output.styles); # => .block{background-image:url(../valid/path/to/image.png)}
554 ## How to specify a custom rounding precision?
568 which sets all units rounding precision to 3 digits except `px` unit precision of 5 digits.
570 ## How to keep a CSS fragment intact?
572 Note: available in the current master, to be released in 4.2.0.
574 Wrap the CSS fragment in special comments which instruct clean-css to preserve it, e.g.
600 ## How to preserve a comment block?
610 ## How to rebase relative image URLs?
614 * when full paths to input files are passed in as options;
618 ## How to work with source maps?
630 You can also pass an input source map directly as a 2nd argument to `minify` method:
635 // access output.sourceMap to access SourceMapGenerator object
644 'path/to/source/1': {
648 'path/to/source/2': {
657 ## How to apply level 1 & 2 optimizations at the same time?
682 …ing, and restoring them back. You may want to use `mergeIntoShorthands` option to control whether …
686 … which can be moved (!) to be merged, requires all intermediate rulesets to not redefine the moved…
688 * `restructure` - tries to reorganize different-selector different-rules rulesets so they take less…
693 ## How to use clean-css with build tools?
695 There is a number of 3rd party plugins to popular build tools:
707 ## How to use clean-css from web browser?
717 ## How to get started?
732 then use any of the following commands to verify your copy:
736 npm run browserify # to create the browser-ready clean-css version
737 npm run check # to lint JS sources with [JSHint](https://github.com/jshint/jshint/)
738 npm test # to run all tests
745 * [@abarre](https://github.com/abarre) (Anthony Barre) for improvements to `@import` processing;
757 * [@wagenet](https://github.com/wagenet) (Peter Wagenet) for suggesting improvements to `@import` i…
759 …nt Voyer) for a patch with better empty element regex and for inspiring us to do many performance …
760 * [@xhmikosr](https://github.com/xhmikosr) for suggesting new features, like option to remove speci…