The main obstacle on reordering and merging declarations is a fact that arbitrary classes can be applied to an element and at CSS level we don't know if that's the case or not. However with semantic merging mode on we trust CSS author knows what she is doing. This commit is just a start (see #588) of a journey. It is and will always be turned off by default as it requires certain effort from stylesheets' author. So far plain class selectors and some BEM basics are supported.
When handling input source map it checks whether sourcesContent is present and if it is so then it's reused in the output source map. Adds `sourceMapInlineSources` / `--source-map-inline-source` switches to control whether an inlined source map is created or not. In case an input source map with a `sourcesContent` field is provided then all sources from that source map are carried over to the output source map.
Fixes warning with node.js 0.12.
Adds a CLI & API switches to turn off restructuring, which is on by default.
* It's enabled in CLI only if output file is given.
…sabling shorthand compacting. * Also disables shorthand compacting for source maps as it is not defined well enough, yet.
* Manages compatibility options as a hash of options. * Handles fallback to previous compatibility options.
* Rewrote inliner to process data asynchronously. * Supports 2xx responses, redirects, errors, and timeouts. * Supports cyclical references. * Supports protocol-less requests (defaults to HTTP). * Supports overriding request options - see http://nodejs.org/api/http.html#http_http_request_options_callback * Supports timeout in ./bin/cleancss via --timeout / -t switches. * Supports inlining local resources only without a callback. * Supports rebasing URLs in remote @imports. * Always triggers a callback asynchronously.
…patibility' switch. * 'selectorsMergeMode' option to library is also renamed to 'compatibility'.
…ibrary. * Does not throw errors anymore, instead prints them out to STDERR and exits with status 1. * Adds two new fields to CleanCSS objects - warnings and errors. * Updates imports/inliner.js to not act as a singleton. * Adds 'both root and output file given' warning to inliner.
…g: true` option. * Refactors CLI `--debug` to use these stats too. * Moves `originalSize` field into `stats` one.
* Skips if selector is vendor specific, i.e. matches /-(moz|ms|o|webkit)-/. * Will not merge selectors if one selector may not be supported, e.g. :nth-child, :last-child, etc. - configurable via `--selectors-merge-mode/selectorsMergeMode` option. * Defaults to merging all selectors so `ie8` mode needs to be forced via mentioned options.