* Makes all multiple selectors ordered alphabetically (aids merging).
* Adds property overriding so more coarse properties override more granular ones.
* Adds reducing non-adjacent selectors.
+* Adds `--skip-advanced`/`noAdvanced` switch to disable advanced optimizations.
1.1.7 / 2013-10-28
==================
-o, --output [output-file] Use [output-file] as output instead of STDOUT
-s, --skip-import Disable @import processing
--skip-rebase Disable URLs rebasing
+--skip-advanced Disable advanced optimizations - selector & property merging, reduction, etc.
--selectors-merge-mode [ie8|*] Use `ie8` for compatibility mode, `*` for merge all (default).
-d, --debug Shows debug information (minification time & compression efficiency)
```
* `relativeTo` - path with which to resolve relative `@import` rules and URLs
* `processImport` - whether to process `@import` rules
* `noRebase` - whether to skip URLs rebasing
+* `noAdvanced` - set to true to disable advanced optimizations - selector & property merging, reduction, etc.
* `selectorsMergeMode` - `ie8` for IE8 compatibility mode, `*` for merging all (default)
### What are the clean-css' dev commands?
.option('-o, --output [output-file]', 'Use [output-file] as output instead of STDOUT')
.option('-s, --skip-import', 'Disable @import processing')
.option('--skip-rebase', 'Disable URLs rebasing')
+ .option('--skip-advanced', 'Disable advanced optimizations - selector & property merging, reduction, etc.')
.option('--selectors-merge-mode [ie8|*]', 'Use `ie8` for compatibility mode, `*` for merge all (default).')
.option('-d, --debug', 'Shows debug information (minification time & compression efficiency)');
cleanOptions.processImport = false;
if (commands.skipRebase)
cleanOptions.noRebase = true;
+if (commands.skipAdvanced)
+ cleanOptions.noAdvanced = true;
if (commands.selectorsMergeMode)
cleanOptions.selectorsMergeMode = commands.selectorsMergeMode;
if (commands.debug)
return match.replace(/\+/g, ' + ');
});
- replace(function optimizeSelectors() {
- data = new SelectorsOptimizer(data, {
- keepBreaks: options.keepBreaks,
- lineBreak: lineBreak,
- selectorsMergeMode: options.selectorsMergeMode
- }).process();
- });
+ if (!options.noAdvanced) {
+ replace(function optimizeSelectors() {
+ data = new SelectorsOptimizer(data, {
+ keepBreaks: options.keepBreaks,
+ lineBreak: lineBreak,
+ selectorsMergeMode: options.selectorsMergeMode
+ }).process();
+ });
+ }
replace(function restoreUrls() {
data = urlsProcessor.restore(data);
deleteFile('debug.css');
}
}),
+ 'skip advanced optimizations': pipedContext('a{color:red}p{color:red}', '--skip-advanced', {
+ 'should do basic optimizations only': function(error, stdout) {
+ assert.equal(stdout, 'a{color:red}p{color:red}');
+ }
+ }),
'no relative to path': binaryContext('./test/data/partials-absolute/base.css', {
'should not be able to resolve it fully': function(error, stdout) {
assert.equal(stdout, '');
"@import url(/fake.css);"
]
}, { processImport: false }),
+ 'duplicate selectors with disabled advanced processing': cssContext({
+ 'of a duplicate selector': 'a,a{color:red}'
+ }, { noAdvanced: true }),
'duplicate selectors in a list': cssContext({
'of a duplicate selector': [
'a,a{color:red}',