clean-css.git
10 years agoAdds faster selectors processing in advanced optimizer.
Jakub Pawlowicz [Wed, 19 Feb 2014 07:43:26 +0000 (07:43 +0000)]
Adds faster selectors processing in advanced optimizer.

Selectors clean up is not needed in case of a single selector being processed.

10 years agoFixes #241 - incorrect handling of :not() selectors.
Jakub Pawlowicz [Wed, 19 Feb 2014 07:38:15 +0000 (07:38 +0000)]
Fixes #241 - incorrect handling of :not() selectors.

Since :not() can have multiple selectors passed in, e.g. :not(div,span),
commas need to be handled in a more clever way.

10 years agoMerge pull request #242 from lukeapage/patch-1
Goal Smashers Dev Team [Tue, 18 Feb 2014 08:02:14 +0000 (08:02 +0000)]
Merge pull request #242 from lukeapage/patch-1

Adds compatibility to programmability section too.

10 years agoAdd compatibility to programmability section too
Luke Page [Tue, 18 Feb 2014 07:20:05 +0000 (07:20 +0000)]
Add compatibility to programmability section too

10 years agoVersion 2.1.0.
Jakub Pawlowicz [Thu, 13 Feb 2014 22:45:51 +0000 (22:45 +0000)]
Version 2.1.0.

10 years agoAdds better structured batch tests.
Jakub Pawlowicz [Thu, 13 Feb 2014 21:54:49 +0000 (21:54 +0000)]
Adds better structured batch tests.

Use of async topic prevents individual fails from stopping subsequent tests from being run.

10 years agoAdds a full list of unsupported selectors on IE7 and IE8.
Jakub Pawlowicz [Mon, 10 Feb 2014 22:18:40 +0000 (22:18 +0000)]
Adds a full list of unsupported selectors on IE7 and IE8.

Makes sure we don't merge all unsupported selectors as per list at:
http://kimblim.dk/css-tests/selectors/

10 years agoFixes #235 - adds IE7 compatibility mode.
Jakub Pawlowicz [Mon, 10 Feb 2014 21:53:36 +0000 (21:53 +0000)]
Fixes #235 - adds IE7 compatibility mode.

:focus, :after, and :before selectors are not supported in IE7 so we can't
merge selectors using them.

10 years agoFixes #236 - incorrect rebasing with nested `import`s.
Jakub Pawlowicz [Mon, 10 Feb 2014 21:29:15 +0000 (21:29 +0000)]
Fixes #236 - incorrect rebasing with nested `import`s.

Because of a typo, rebasing of nested relative imports were not processed correctly,
leading to relative paths to last @import not the original one.

Thanks to @alexeyraspopov for spotting it!

10 years agoFixes #226 - skips border:none => border:0 minification.
Jakub Pawlowicz [Sun, 9 Feb 2014 21:34:54 +0000 (21:34 +0000)]
Fixes #226 - skips border:none => border:0 minification.

It's not always safe. See http://dabblet.com/gist/8716224 for details.

10 years agoFixes #223 - adjacent selectors merging.
Jakub Pawlowicz [Sun, 9 Feb 2014 21:15:39 +0000 (21:15 +0000)]
Fixes #223 - adjacent selectors merging.

Makes sure removing duplicates and merging adjacent selectors is run twice, beforehand the latter was not the case.
This is because adjacent selectors may be merged in the first pass creating opportunity to further improve minification.

10 years agoVersion 2.0.8.
Jakub Pawlowicz [Fri, 7 Feb 2014 21:09:27 +0000 (21:09 +0000)]
Version 2.0.8.

10 years agoFixes #232 - edge case in non-adjacent selectors merging.
Jakub Pawlowicz [Fri, 7 Feb 2014 21:07:24 +0000 (21:07 +0000)]
Fixes #232 - edge case in non-adjacent selectors merging.

Gets rid of an edge case when non-adjacent selectors merging can lead to incorrect overridding of properties.

10 years agoFixes #230 - adds better handling of zero values.
Jakub Pawlowicz [Wed, 5 Feb 2014 07:14:02 +0000 (07:14 +0000)]
Fixes #230 - adds better handling of zero values.

Previously 0.0 + unit and -0 was handled incorrectly.

10 years agoFixes #229 - adds improved processing of fraction numbers.
GoalSmashers [Mon, 3 Feb 2014 06:24:07 +0000 (06:24 +0000)]
Fixes #229 - adds improved processing of fraction numbers.

opacity:1. => opacity:1
opacity:.0 => opacity:0

10 years agoFixes #215 - adds removing leading zeros from numerical values.
GoalSmashers [Mon, 3 Feb 2014 04:37:36 +0000 (04:37 +0000)]
Fixes #215 - adds removing leading zeros from numerical values.

E.g 040px can be safely turned into 40px.

10 years agoFixes #217 - removing extra whitespace from attribute selectors and urls.
GoalSmashers [Sat, 1 Feb 2014 08:12:53 +0000 (08:12 +0000)]
Fixes #217 - removing extra whitespace from attribute selectors and urls.

Browsers strip the whitespace before evaluating so should we.

10 years agoFixes #220 - universal selector between two comments.
GoalSmashers [Sat, 1 Feb 2014 07:47:17 +0000 (07:47 +0000)]
Fixes #220 - universal selector between two comments.

Comments were incorrectly processed when universal selector was placed in between.

10 years agoFixes #218 - gets rid of @import statements appearing after CSS content.
GoalSmashers [Sat, 1 Feb 2014 07:30:24 +0000 (07:30 +0000)]
Fixes #218 - gets rid of @import statements appearing after CSS content.

See www.w3.org/TR/CSS21/cascade.html#at-import for details.

10 years agoFixes out of bounds values in rgb / rgba declarations. See #216.
GoalSmashers [Thu, 30 Jan 2014 08:05:26 +0000 (08:05 +0000)]
Fixes out of bounds values in rgb / rgba declarations. See #216.

10 years agoFixes #216 - handling 0% in rgb / rgba declarations.
GoalSmashers [Thu, 30 Jan 2014 08:04:15 +0000 (08:04 +0000)]
Fixes #216 - handling 0% in rgb / rgba declarations.

10 years agoFixes #213 - faster rgb to hex transforms.
tomByrer [Thu, 30 Jan 2014 07:44:13 +0000 (07:44 +0000)]
Fixes #213 - faster rgb to hex transforms.

10 years agoFixes path slashes in Readme to correct ones.
Goal Smashers Dev Team [Sun, 26 Jan 2014 13:36:26 +0000 (13:36 +0000)]
Fixes path slashes in Readme to correct ones.

10 years agoFixes #212 - adds contributing rules to readme.
Goal Smashers Dev Team [Sun, 26 Jan 2014 11:16:25 +0000 (11:16 +0000)]
Fixes #212 - adds contributing rules to readme.

Adds more information on how to contribute and where to put tests.

10 years agoVersion 2.0.7.
GoalSmashers [Thu, 16 Jan 2014 22:22:15 +0000 (22:22 +0000)]
Version 2.0.7.

10 years agoFixes #208 - fixes swallowing `@viewport`, `@page`, and `@supports` when doing advanc...
GoalSmashers [Thu, 16 Jan 2014 22:20:24 +0000 (22:20 +0000)]
Fixes #208 - fixes swallowing `@viewport`, `@page`, and `@supports` when doing advanced optimizations.

10 years agoFixes #207 - bug in parsing protocol `@import`s.
GoalSmashers [Sat, 11 Jan 2014 15:56:34 +0000 (16:56 +0100)]
Fixes #207 - bug in parsing protocol `@import`s.

Spaces inside url part of import declaration were incorrectly parsed.

10 years agoMerge pull request #206 from XhmikosR/master
Goal Smashers Dev Team [Sat, 11 Jan 2014 14:21:55 +0000 (06:21 -0800)]
Merge pull request #206 from XhmikosR/master

Update nock dependency.

10 years agoUpdate nock dependency.
XhmikosR [Sat, 11 Jan 2014 08:36:48 +0000 (10:36 +0200)]
Update nock dependency.

10 years agoFixes debug mode stats for stylesheets using `@import` statements.
GoalSmashers [Thu, 12 Dec 2013 16:30:54 +0000 (17:30 +0100)]
Fixes debug mode stats for stylesheets using `@import` statements.

* Size of inlined files were not taken into account resulting in wrong "Original size" and "Efficiency".

10 years agoAdds inlining info in debug mode.
GoalSmashers [Thu, 12 Dec 2013 16:01:23 +0000 (17:01 +0100)]
Adds inlining info in debug mode.

10 years agoFixes #85 - adds resolving protocol @import statements.
GoalSmashers [Tue, 10 Dec 2013 12:14:54 +0000 (13:14 +0100)]
Fixes #85 - adds resolving protocol @import statements.

* 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.

10 years agoAdds an optional callback to CleanCSS#minify method.
GoalSmashers [Tue, 10 Dec 2013 09:18:08 +0000 (10:18 +0100)]
Adds an optional callback to CleanCSS#minify method.

10 years agoVersion 2.0.6.
GoalSmashers [Sat, 4 Jan 2014 16:01:26 +0000 (17:01 +0100)]
Version 2.0.6.

10 years agoFixes #198 - correctly handle a mixup of comments and @import statements.
GoalSmashers [Fri, 27 Dec 2013 11:27:18 +0000 (12:27 +0100)]
Fixes #198 - correctly handle a mixup of comments and @import statements.

This is a follow up to #192 which apparently fixed an edge case of processing
more than one @import inside a comment but introduced this issue.

10 years agoFixes #205 - freeze on broken @import declaration.
GoalSmashers [Fri, 3 Jan 2014 14:58:38 +0000 (15:58 +0100)]
Fixes #205 - freeze on broken @import declaration.

@import declarations without trailing semicolon led to an infinite loop in tokenizer.

10 years agoUpdates copyright stamps.
GoalSmashers [Fri, 3 Jan 2014 11:23:08 +0000 (12:23 +0100)]
Updates copyright stamps.

10 years agoMerge branch 'master' of github.com:GoalSmashers/clean-css
GoalSmashers [Fri, 3 Jan 2014 11:22:21 +0000 (12:22 +0100)]
Merge branch 'master' of github.com:GoalSmashers/clean-css

10 years agoVersion 2.0.5.
GoalSmashers [Fri, 3 Jan 2014 11:10:47 +0000 (12:10 +0100)]
Version 2.0.5.

10 years agoFixes #203 - passing Buffer instance as a first argument to minify method.
GoalSmashers [Fri, 3 Jan 2014 11:06:48 +0000 (12:06 +0100)]
Fixes #203 - passing Buffer instance as a first argument to minify method.

10 years agoFixes #199 - keeps line breaks if requested when advanced optimizations are off.
GoalSmashers [Wed, 25 Dec 2013 10:00:44 +0000 (11:00 +0100)]
Fixes #199 - keeps line breaks if requested when advanced optimizations are off.

10 years agoMerge pull request #200 from XhmikosR/master
Goal Smashers Dev Team [Fri, 27 Dec 2013 12:56:23 +0000 (04:56 -0800)]
Merge pull request #200 from XhmikosR/master

Minor improvements

10 years agoUpdate JSHint dependency.
XhmikosR [Fri, 27 Dec 2013 03:50:13 +0000 (05:50 +0200)]
Update JSHint dependency.

10 years agoUpdate README.md.
XhmikosR [Mon, 25 Nov 2013 08:47:21 +0000 (10:47 +0200)]
Update README.md.

* switch to the shields.io theme for the dependency badges
* use the link to the our comparison page
* use the proper case for Node.js and Grunt

10 years agoVersion 2.0.4.
GoalSmashers [Thu, 19 Dec 2013 14:20:40 +0000 (15:20 +0100)]
Version 2.0.4.

10 years agoMerge pull request #193 from MWers/hsl-range
Goal Smashers Dev Team [Thu, 19 Dec 2013 14:15:18 +0000 (06:15 -0800)]
Merge pull request #193 from MWers/hsl-range

Adds out-of-bounds handling for HSL colors.

10 years agoAdded out-of-bounds handling for hslToRgb function with unit tests
Matt Walker [Tue, 17 Dec 2013 05:58:16 +0000 (21:58 -0800)]
Added out-of-bounds handling for hslToRgb function with unit tests

10 years agoVersion 2.0.3.
GoalSmashers [Wed, 18 Dec 2013 22:05:31 +0000 (23:05 +0100)]
Version 2.0.3.

10 years agoFixes #192 - many `@import`s inside a comment.
GoalSmashers [Wed, 18 Dec 2013 21:49:48 +0000 (22:49 +0100)]
Fixes #192 - many `@import`s inside a comment.

* Broken comments scanner when more than one import inside a comment.

10 years agoFixes #191 - quotes around font name should not be removed if value starts with a...
GoalSmashers [Wed, 18 Dec 2013 20:08:41 +0000 (21:08 +0100)]
Fixes #191 - quotes around font name should not be removed if value starts with a digit.

10 years agoFixes #186 - strips unit from `0rem` unless in ie8 compatibility mode.
GoalSmashers [Wed, 11 Dec 2013 18:24:08 +0000 (19:24 +0100)]
Fixes #186 - strips unit from `0rem` unless in ie8 compatibility mode.

10 years agoDeprecates '--selectors-merge-mode' in favor of a more generic '--compatibility'...
GoalSmashers [Wed, 11 Dec 2013 17:48:45 +0000 (18:48 +0100)]
Deprecates '--selectors-merge-mode' in favor of a more generic '--compatibility' switch.

* 'selectorsMergeMode' option to library is also renamed to 'compatibility'.

10 years agoMerge pull request #189 from stephenmathieson/refactor/convert-to-constructor
Goal Smashers Dev Team [Thu, 5 Dec 2013 19:10:01 +0000 (11:10 -0800)]
Merge pull request #189 from stephenmathieson/refactor/convert-to-constructor

Converts CleanCSS function into a constructor.

10 years agoFixes #188 - Convert CleanCSS to a constructor
Stephen Mathieson [Thu, 5 Dec 2013 17:07:56 +0000 (12:07 -0500)]
Fixes #188 - Convert CleanCSS to a constructor

This allows for adding custom methods on the CleanCSS prototype.

10 years agoMerge pull request #187 from XhmikosR/commander
Goal Smashers Dev Team [Tue, 26 Nov 2013 14:46:23 +0000 (06:46 -0800)]
Merge pull request #187 from XhmikosR/commander

Updates commander dependency.

10 years agoUpdate commander dependency.
XhmikosR [Mon, 25 Nov 2013 08:40:25 +0000 (10:40 +0200)]
Update commander dependency.

10 years agoMerge pull request #183 from XhmikosR/hrtime
Goal Smashers Dev Team [Wed, 20 Nov 2013 15:33:35 +0000 (07:33 -0800)]
Merge pull request #183 from XhmikosR/hrtime

Remove check for `process.hrtime()`.

10 years agoRemove check for `process.hrtime()`.
XhmikosR [Tue, 19 Nov 2013 17:33:46 +0000 (19:33 +0200)]
Remove check for `process.hrtime()`.

Node.js 0.8 is required already.

10 years agoVersion 2.0.2.
GoalSmashers [Mon, 18 Nov 2013 21:30:50 +0000 (22:30 +0100)]
Version 2.0.2.

10 years agoFixes #177 - processing incorrect content should not break CSS.
GoalSmashers [Mon, 18 Nov 2013 21:01:37 +0000 (22:01 +0100)]
Fixes #177 - processing incorrect content should not break CSS.

* Adds a warning on an incorrect content or a closing parenthesis.

10 years agoMoves grunt info after CLI and module use so the order is more logical.
Goal Smashers Dev Team [Mon, 18 Nov 2013 18:08:19 +0000 (19:08 +0100)]
Moves grunt info after CLI and module use so the order is more logical.

10 years agoFixes #180 - adds grunt info to readme.
Goal Smashers Dev Team [Mon, 18 Nov 2013 18:05:42 +0000 (19:05 +0100)]
Fixes #180 - adds grunt info to readme.

10 years agoFixes #160 - re-runs advanced optimizations until no changes are detected.
GoalSmashers [Mon, 18 Nov 2013 09:43:18 +0000 (10:43 +0100)]
Fixes #160 - re-runs advanced optimizations until no changes are detected.

* That's because merging adjacent selectors can lead to new optimization opportunities.

10 years agoSkips empty removal if advanced processing is enabled.
GoalSmashers [Sun, 17 Nov 2013 14:33:13 +0000 (15:33 +0100)]
Skips empty removal if advanced processing is enabled.

* Since advanced processing tokenizes data we can rebuild it without empty elements.

10 years agoAdds minor speeed optimizations to property & selector optimizers.
GoalSmashers [Sun, 17 Nov 2013 12:05:00 +0000 (13:05 +0100)]
Adds minor speeed optimizations to property & selector optimizers.

10 years agoFixes #161 - adds ~30x faster tokenizer.
GoalSmashers [Sun, 17 Nov 2013 09:31:04 +0000 (10:31 +0100)]
Fixes #161 - adds ~30x faster tokenizer.

* Splits data into 128 bytes long chunks (rounded to nearest closing parenthesis).
* Won't seek trough the whole document all the time.

10 years agoFixes #163 - adds pixel rounding to 2nd decimal place.
GoalSmashers [Sat, 16 Nov 2013 12:01:14 +0000 (13:01 +0100)]
Fixes #163 - adds pixel rounding to 2nd decimal place.

10 years agoFixes #165 - adds removing extra space after rgba/hsla declarations.
GoalSmashers [Sat, 16 Nov 2013 09:59:18 +0000 (10:59 +0100)]
Fixes #165 - adds removing extra space after rgba/hsla declarations.

10 years agoVersion 2.0.1.
GoalSmashers [Thu, 14 Nov 2013 08:38:14 +0000 (09:38 +0100)]
Version 2.0.1.

10 years agoFixes #176 - hangs when `undefined` is used as a property value.
GoalSmashers [Thu, 14 Nov 2013 08:31:30 +0000 (09:31 +0100)]
Fixes #176 - hangs when `undefined` is used as a property value.

10 years agoMerge pull request #175 from XhmikosR/master
Goal Smashers Dev Team [Sat, 9 Nov 2013 14:55:32 +0000 (06:55 -0800)]
Merge pull request #175 from XhmikosR/master

Minor style changes.

10 years agoMinor style changes.
XhmikosR [Fri, 8 Nov 2013 16:39:54 +0000 (18:39 +0200)]
Minor style changes.

10 years agoMerge pull request #174 from XhmikosR/master
Goal Smashers Dev Team [Tue, 5 Nov 2013 13:39:01 +0000 (05:39 -0800)]
Merge pull request #174 from XhmikosR/master

Minor improvements.

10 years agoUpdate JSHint's options.
XhmikosR [Mon, 4 Nov 2013 11:06:39 +0000 (13:06 +0200)]
Update JSHint's options.

Enable indent option and move multistr option where is needed only.

10 years agoAdd "bin/cleancss" to the JSHint command and fix the warnings.
XhmikosR [Mon, 4 Nov 2013 09:51:56 +0000 (11:51 +0200)]
Add "bin/cleancss" to the JSHint command and fix the warnings.

10 years agoAdds a direct link to css-minification-benchmark results.
Goal Smashers Dev Team [Mon, 4 Nov 2013 16:21:11 +0000 (17:21 +0100)]
Adds a direct link to css-minification-benchmark results.

10 years agoVersion 2.0.0.
GoalSmashers [Mon, 4 Nov 2013 13:31:25 +0000 (14:31 +0100)]
Version 2.0.0.

10 years agoRenames test/custom-test.js to test/module-test.js.
GoalSmashers [Mon, 4 Nov 2013 12:29:44 +0000 (13:29 +0100)]
Renames test/custom-test.js to test/module-test.js.

10 years agoUpdates unit tests to allow flat arguments only in cssContext.
GoalSmashers [Mon, 4 Nov 2013 12:26:33 +0000 (13:26 +0100)]
Updates unit tests to allow flat arguments only in cssContext.

* There is no ' #<number>' appended to test name anymore.

10 years agoFixes #146 - moves benchmark out of the repository.
GoalSmashers [Mon, 4 Nov 2013 12:04:52 +0000 (13:04 +0100)]
Fixes #146 - moves benchmark out of the repository.

* Updates clean-css tagline to include a link to css-minification-benchmark.

10 years agoRearranges History.md a bit.
GoalSmashers [Mon, 4 Nov 2013 11:05:29 +0000 (12:05 +0100)]
Rearranges History.md a bit.

10 years agoFixes #139 - adds consistent error and warning handling for CLI and library.
GoalSmashers [Mon, 4 Nov 2013 09:30:07 +0000 (10:30 +0100)]
Fixes #139 - adds consistent error and warning handling for CLI and library.

* 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.

10 years agoMerge pull request #171 from XhmikosR/master
Goal Smashers Dev Team [Mon, 4 Nov 2013 10:33:49 +0000 (02:33 -0800)]
Merge pull request #171 from XhmikosR/master

Forces single quotes via JSHint.

10 years agoUpdate JSHint options.
XhmikosR [Mon, 4 Nov 2013 10:10:28 +0000 (12:10 +0200)]
Update JSHint options.

10 years agoStyle consistency changes.
XhmikosR [Mon, 4 Nov 2013 09:55:39 +0000 (11:55 +0200)]
Style consistency changes.

10 years agoForce usage of single quotes in JSHint.
XhmikosR [Mon, 4 Nov 2013 09:02:20 +0000 (11:02 +0200)]
Force usage of single quotes in JSHint.

10 years agoFixes #166 - output more info in CLI's `debug` mode.
GoalSmashers [Mon, 4 Nov 2013 08:01:52 +0000 (09:01 +0100)]
Fixes #166 - output more info in CLI's `debug` mode.

* Show efficiency with up to two decimal places.

10 years agoFixes #145 - adds minifications stats when calling library with `debug: true` option.
GoalSmashers [Mon, 4 Nov 2013 07:24:42 +0000 (08:24 +0100)]
Fixes #145 - adds minifications stats when calling library with `debug: true` option.

* Refactors CLI `--debug` to use these stats too.
* Moves `originalSize` field into `stats` one.

10 years agoMerge pull request #169 from XhmikosR/master
Goal Smashers Dev Team [Mon, 4 Nov 2013 07:17:36 +0000 (23:17 -0800)]
Merge pull request #169 from XhmikosR/master

Updates docs & history.

10 years agoFixes #138 - makes CleanCSS interface fully object oriented.
GoalSmashers [Sun, 3 Nov 2013 14:27:44 +0000 (15:27 +0100)]
Fixes #138 - makes CleanCSS interface fully object oriented.

* use `new CleanCSS(options).minify(css)` to minify CSS.
* adds 1.x -> 2.x migration guide.

10 years agoUpdate docs.
XhmikosR [Sat, 2 Nov 2013 23:04:49 +0000 (01:04 +0200)]
Update docs.

10 years agoFixes #167 - `background:transparent` minification.
GoalSmashers [Sun, 3 Nov 2013 12:08:24 +0000 (13:08 +0100)]
Fixes #167 - `background:transparent` minification.

* It is safe to make it `background:0 0`.

10 years agoImproves property overriding & redefining algorithm.
GoalSmashers [Sat, 2 Nov 2013 20:12:50 +0000 (21:12 +0100)]
Improves property overriding & redefining algorithm.

* Handles redefining overridden properties.
* Treats -ms-filter/filter as a background / background-image property.

10 years agoAdds reducing non-adjacent selectors when overridden by more complex selectors.
GoalSmashers [Sat, 2 Nov 2013 12:07:41 +0000 (13:07 +0100)]
Adds reducing non-adjacent selectors when overridden by more complex selectors.

* E.g. "strong{color:red}.one,strong{color:#fff}" can be reduced to ".one,strong{color:#fff}".
* Fixes property optimizer when body is empty.
* Fixes property optimizer with merging on joins.

10 years agoAdds ignoring misplaced top level curly braces.
GoalSmashers [Fri, 1 Nov 2013 17:14:41 +0000 (18:14 +0100)]
Adds ignoring misplaced top level curly braces.

10 years agoAdds `--skip-advanced`/`noAdvanced` switch to disable advanced optimizations.
GoalSmashers [Fri, 1 Nov 2013 14:11:25 +0000 (15:11 +0100)]
Adds `--skip-advanced`/`noAdvanced` switch to disable advanced optimizations.

10 years agoAdds reducing non-adjacent selectors.
GoalSmashers [Thu, 31 Oct 2013 16:29:13 +0000 (17:29 +0100)]
Adds reducing non-adjacent selectors.

* Removes repeated properties in same selectors which are not next to each other.
* E.g. '.one{color:red;margin:0}.two{color:#fff}.one{margin:1px}' will become '.one{color:red}.two{color:#fff}.one{margin:1px}' because margin is repeated.

10 years agoAdds property overriding so more coarse properties override more granular ones.
GoalSmashers [Thu, 31 Oct 2013 08:16:26 +0000 (09:16 +0100)]
Adds property overriding so more coarse properties override more granular ones.

* E.g. 'border-top' overrides 'border-top-width' and 'border-top-color'.
* Another example is 'margin' overriding 'margin-(bottom|left|right|top)'.

10 years agoRefactors property merging into a separate Optimizer singleton.
GoalSmashers [Wed, 30 Oct 2013 19:57:49 +0000 (20:57 +0100)]
Refactors property merging into a separate Optimizer singleton.

10 years agoAdds merging adjacent selectors if body is the same.
GoalSmashers [Mon, 28 Oct 2013 21:03:59 +0000 (22:03 +0100)]
Adds merging adjacent selectors if body is the same.

* 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.