* Reworks minification to tokenize first then minify.
See [changes](https://github.com/jakubpawlowicz/clean-css/compare/b06f37d...dd8c14a).
* Renames `noAdvanced` option into `advanced`.
+* Renames `noAggressiveMerging` option into `aggressiveMerging`.
* Speeds up advanced processing by shortening optimize loop.
* Fixed issue [#360](https://github.com/GoalSmashers/clean-css/issues/360) - adds 7 extra CSS colors.
#### Module interface
* `noAdvanced` became `advanced` - make sure to reverse the value;
+* `noAggressiveMerging` became `aggressiveMerging` - make sure to reverse the value;
* no longer possible to use `CleanCSS` as a function as `new CleanCSS` is always required;
### How to upgrade clean-css from 1.x to 2.x?
`new CleanCSS(options).minify(source)` with the following options available:
* `advanced` - set to false to disable advanced optimizations - selector & property merging, reduction, etc.
+* `aggressiveMerging` - set to false to disable aggressive merging of properties.
* `benchmark` - turns on benchmarking mode measuring time spent on cleaning up (run `npm run bench` to see example)
* `compatibility` - Force compatibility mode to `ie7` or `ie8`. Defaults to not set.
* `debug` - set to true to get minification statistics under `stats` property (see `test/custom-test.js` for examples)
* `inliner` - a hash of options for `@import` inliner, see test/protocol-imports-test.js for examples
* `keepBreaks` - whether to keep line breaks (default is false)
* `keepSpecialComments` - `*` for keeping all (default), `1` for keeping first one only, `0` for removing all
-* `noAggressiveMerging` - set to true to disable aggressive merging of properties.
* `noRebase` - whether to skip URLs rebasing
* `processImport` - whether to process `@import` rules
* `relativeTo` - path to __resolve__ relative `@import` rules and URLs
if (commands.skipAdvanced)
cleanOptions.advanced = false;
if (commands.skipAggressiveMerging)
- cleanOptions.noAggressiveMerging = true;
+ cleanOptions.aggressiveMerging = false;
if (commands.compatibility)
cleanOptions.compatibility = commands.compatibility;
if (commands.roundingPrecision !== undefined)
this.options = {
advanced: options.advanced === undefined ? true : false,
+ aggressiveMerging: undefined === options.aggressiveMerging ? true : false,
benchmark: options.benchmark,
compatibility: options.compatibility,
debug: options.debug,
inliner: options.inliner,
keepBreaks: options.keepBreaks || false,
keepSpecialComments: 'keepSpecialComments' in options ? options.keepSpecialComments : '*',
- noAggressiveMerging: options.noAggressiveMerging,
noRebase: options.noRebase,
processImport: undefined === options.processImport ? true : false,
relativeTo: options.relativeTo,
keepBreaks: options.keepBreaks,
advanced: options.advanced,
compatibility: options.compatibility,
- aggressiveMerging: !options.noAggressiveMerging,
+ aggressiveMerging: options.aggressiveMerging,
roundingPrecision: options.roundingPrecision
}, context);
'a{background:red;display:block;background:white}',
'a{display:block;background:#fff}'
]
- }, { noAggressiveMerging: true }),
+ }, { aggressiveMerging: false }),
'same selectors': cssContext({
'of two non-adjacent selectors': '.one{color:red}.two{color:#00f}.one{font-weight:700}',
'of two adjacent single selectors': [