Jakub Pawlowicz [Mon, 26 Dec 2016 11:42:08 +0000 (12:42 +0100)]
Reworks inlining so resources are loaded lazily.
Why:
* when using a hash as an input, the sources it references
should be processed lazily instead of a whole hash being
serialized & tokenized eagerly.
This change addresses the need by:
* See #791 - in-memory imports require such lazy processing.
The other way, we end up with duplicated rules, and have to rely
on advanced processing to remove them.
Jakub Pawlowicz [Sun, 25 Dec 2016 14:38:04 +0000 (15:38 +0100)]
Fixes #791 - resolves imports in-memory if possible.
Why:
* When a hash is given as a source, some imports can be inlined
in-memory taking styles from the hash.
Jakub Pawlowicz [Fri, 23 Dec 2016 22:00:46 +0000 (23:00 +0100)]
See #710 - adds a test case to prevent regressions.
Jakub Pawlowicz [Fri, 23 Dec 2016 21:00:43 +0000 (22:00 +0100)]
See #808 - adds a test case to prevent regressions.
Jakub Pawlowicz [Fri, 23 Dec 2016 20:43:50 +0000 (21:43 +0100)]
Fixes #845 - fixes web compatibility in 4.0.
Why:
* 4.0 calculates stats by default but `process.hrtime` is not
available inside browsers. However, since we don't need
sub-ms resolution, `Date.now()` can be used instead.
Jakub Pawlowicz [Fri, 23 Dec 2016 19:54:45 +0000 (20:54 +0100)]
Fixes #685 - adds lowercase hex color normalization.
Why:
* This change does not affect color interpretation.
* Allow potential merging improvements as colors are normalized.
Jakub Pawlowicz [Fri, 23 Dec 2016 17:24:56 +0000 (18:24 +0100)]
See #560 - adds a test case to prevent future regressions.
Jakub Pawlowicz [Fri, 23 Dec 2016 17:05:17 +0000 (18:05 +0100)]
Fixes #847 - ignores selectors with invalid characters.
Why:
* Browsers won't apply such rules so neither should we.
Jakub Pawlowicz [Thu, 22 Dec 2016 21:18:33 +0000 (22:18 +0100)]
Fixes #758 - ignores rules with empty selectors.
Jakub Pawlowicz [Thu, 22 Dec 2016 20:51:11 +0000 (21:51 +0100)]
Fixes #817 - makes `off` disable rounding.
Why:
* `-1` is still an alias to `off`.
* It won't be used that often as rounding is now disabled
by default.
Jakub Pawlowicz [Thu, 22 Dec 2016 15:13:03 +0000 (16:13 +0100)]
See #209 - adds missing readme for `beautify` option.
Jakub Pawlowicz [Thu, 22 Dec 2016 14:41:58 +0000 (15:41 +0100)]
Fixes #209 - adds output formatting via `beautify` option.
Why:
* So clean-css can be used to format CSS nicely as well.
Jakub Pawlowicz [Thu, 22 Dec 2016 07:59:41 +0000 (08:59 +0100)]
Fixes tokenizer edge case.
If there is a semicolon marker after a property then the property
ends and its reference should be discarded. Otherwise next tokens
may get appended to the property.
Jakub Pawlowicz [Wed, 21 Dec 2016 11:05:46 +0000 (12:05 +0100)]
Fixed #432 - adds URLs normalization.
Why:
* So further merging or compacting can happen more effectively
even when initial URL formatting is different.
Jakub Pawlowicz [Wed, 21 Dec 2016 10:46:14 +0000 (11:46 +0100)]
Fixes #756 - adds disabling font-weight optimizations.
Why:
* Some users reported a need to keep original values;
* Actually we want all optimizations to be configurable.
Jakub Pawlowicz [Wed, 21 Dec 2016 07:37:58 +0000 (08:37 +0100)]
See #657 - adds missing History.md entry.
Jakub Pawlowicz [Tue, 20 Dec 2016 14:47:53 +0000 (15:47 +0100)]
Fixes #686 - adds rounding precision for all units.
** BREAKING CHANGE ** - setting a rounding precision value to a
number applies it to *all* units now, not `px` only.
Why:
* To give users more control over how units are optimized.
Jakub Pawlowicz [Tue, 20 Dec 2016 16:10:47 +0000 (17:10 +0100)]
Fixes #657 - adds property name validation.
It's a bit relaxed matching but too strict one would do too much
harm with many false-positives.
Why:
* To prevent processing errors further down the optimization pipeline.
Jakub Pawlowicz [Tue, 20 Dec 2016 15:22:44 +0000 (16:22 +0100)]
Standardizes <file>:<line>:<column> formatting.
Why:
* When a warning is raised we should give user as much info as
possible, which includes a filename, line and column number.
Jakub Pawlowicz [Mon, 19 Dec 2016 09:26:45 +0000 (10:26 +0100)]
Fixes #818 - disables `px` rounding by default.
Why:
* It is a safer default than `2` which may lead to some
issues with Bootstrap and other CSS frameworks depending
on a high-precision `px` values.
Also see #686 which will make rounding more flexible and
available to all units.
Jakub Pawlowicz [Mon, 19 Dec 2016 09:58:25 +0000 (10:58 +0100)]
Refactors batch-test.js.
Why:
* Wasn't too DRY anymore.
Jakub Pawlowicz [Mon, 19 Dec 2016 09:49:00 +0000 (10:49 +0100)]
Fixes #704 - adds batch CLI tests.
Why:
* To compare output generated by CLI and API (should be the same!).
Jakub Pawlowicz [Mon, 19 Dec 2016 07:16:47 +0000 (08:16 +0100)]
Adds link to official web interface to readme.
Jakub Pawlowicz [Mon, 19 Dec 2016 07:11:29 +0000 (08:11 +0100)]
Adds Readme section on 4.0 breaking changes.
Jakub Pawlowicz [Mon, 19 Dec 2016 06:53:29 +0000 (07:53 +0100)]
See #789 - adds a test case to avoid future regressions.
Jakub Pawlowicz [Mon, 19 Dec 2016 06:43:07 +0000 (07:43 +0100)]
See #809 - adds a test case to avoid future regressions.
Jakub Pawlowicz [Mon, 19 Dec 2016 06:39:24 +0000 (07:39 +0100)]
See #786 - adds a test case to avoid future regressions.
Jakub Pawlowicz [Sun, 18 Dec 2016 15:46:28 +0000 (16:46 +0100)]
Fixes #834 - adds extra line break in nested blocks.
Why:
* It's slightly easier to read when preserving line breaks.
Jakub Pawlowicz [Sun, 18 Dec 2016 11:24:53 +0000 (12:24 +0100)]
Fixes #839 - allows URIs in import inlining rules.
Why:
* To give more control over which resource can and cannot be
inlined.
Jakub Pawlowicz [Sun, 18 Dec 2016 10:02:05 +0000 (11:02 +0100)]
Bumps nock dev dependency to 9.x.
Jakub Pawlowicz [Sat, 17 Dec 2016 17:04:17 +0000 (18:04 +0100)]
Bumps online version to clean-css 3.4.23.
Jakub Pawlowicz [Sat, 17 Dec 2016 16:53:12 +0000 (17:53 +0100)]
Version 3.4.23 release notes.
Jakub Pawlowicz [Sat, 17 Dec 2016 16:46:06 +0000 (17:46 +0100)]
See #844 - fixes matching whitespace in property extraction.
On 3.4 branch it was completely broken whereas on master it had
problems with tab separated values while others were good.
Jakub Pawlowicz [Sat, 17 Dec 2016 12:14:16 +0000 (13:14 +0100)]
Fixes #840 - allows input source map as map object.
Why:
* It's been always odd that we required a serialized JSON when
user may already had it parsed.
Jakub Pawlowicz [Sat, 17 Dec 2016 11:54:27 +0000 (12:54 +0100)]
Fixes #843 - more restrictive quote removal rules.
Why:
* Only remove quotes from selector argument values if allowed.
Jakub Pawlowicz [Sat, 17 Dec 2016 11:15:53 +0000 (12:15 +0100)]
See #843 - fixes an edge case in attribute tidying.
Why:
* We should treat single and double quotes properly as in tokenizer.
Jakub Pawlowicz [Sat, 17 Dec 2016 10:23:38 +0000 (11:23 +0100)]
Fixes 4.0.0-pre Windows tests.
Why:
* This is because of line breaks difference between platforms.
Jakub Pawlowicz [Fri, 16 Dec 2016 10:18:32 +0000 (11:18 +0100)]
Refactors rebasing code.
Why:
* By using the same wording / variable names it is now easier to
understand how rebasing words.
* It's remarkable in how few places we need to rebase paths now. :)
Jakub Pawlowicz [Thu, 15 Dec 2016 20:12:49 +0000 (21:12 +0100)]
Bumps version to 4.0.0-pre.
API and CLI compatibility has been broken thus the major version
needs to move up.
Jakub Pawlowicz [Thu, 15 Dec 2016 16:20:01 +0000 (17:20 +0100)]
Moves all writing-related code to `writer` folder.
Why:
* To make it clearer what it does.
Jakub Pawlowicz [Thu, 15 Dec 2016 16:05:04 +0000 (17:05 +0100)]
Moves all reading-related modules to `reader` folder.
Why:
* Grouping it together for clarity sake.
Jakub Pawlowicz [Wed, 14 Dec 2016 16:19:56 +0000 (17:19 +0100)]
Exposes inlined stylesheet URIs.
Why:
* So the list can be printed in debug mode.
Jakub Pawlowicz [Sun, 11 Dec 2016 10:50:11 +0000 (11:50 +0100)]
Restores source map support.
Re-built from ground up on top of the new tokenizing process
it features simpler rebasing while still supporting all features
of the previous solution.
Jakub Pawlowicz [Sun, 11 Dec 2016 10:26:39 +0000 (11:26 +0100)]
Standardizes parsed tokens.
This commit unifies tokenized values' structure, i.e.
```
[
<TOKEN_NAME>,
<TOKEN_VALUE>,
<METADATA>
]
```
Why:
* So it's easier to work with those values further down the
optimizing pipeline and when restoring back to text content.
Jakub Pawlowicz [Thu, 8 Dec 2016 07:04:31 +0000 (08:04 +0100)]
Simplifies URL rebasing.
** WARNING ** - this is a truly breaking change.
There is now a single option called `rebaseTo`, which denotes a
path all relative URLs are rebased to.
Absolute URLs are kept intact as it's assumed user knows what
he/she does when using them, however absolute @imports are still
inlined relative to the current working directory.
This commit also re-introduces ability to pass arrays to CleanCSS
`minify` method.
** IMPORTANT ** - it'd probably be wise to give users an option
to use a function as `rebaseTo` so they can restore some of old
functionality if needed.
Why:
* The old system with three options (`relativeTo`, `root`, and
`target`) was too hard to understand and work with reliably.
Jakub Pawlowicz [Wed, 7 Dec 2016 12:19:11 +0000 (13:19 +0100)]
Restores accepting `Buffer` as input.
Jakub Pawlowicz [Wed, 7 Dec 2016 10:54:15 +0000 (11:54 +0100)]
Removes `debug` API switch.
Why:
* Stats are always calculated and available under `stats`
property of the output hash.
Jakub Pawlowicz [Tue, 6 Dec 2016 11:14:14 +0000 (12:14 +0100)]
Improves warning & error messages raised during optimizations.
Why:
* We can be more specific about raised errors now.
Jakub Pawlowicz [Tue, 6 Dec 2016 08:06:48 +0000 (09:06 +0100)]
Fixes tokenization on extra close brace.
Why:
* It should be ignored when at the end of tokenized string, but
preserved when in the middle.
Jakub Pawlowicz [Tue, 29 Nov 2016 09:48:00 +0000 (10:48 +0100)]
Reimplements `@import` inlining on top of the new tokenizer.
It works roughly the same as the old inliner but at a different
step: not before tokenization but during it.
Thanks to it there's no need to match import URLs in sources,
deal with comments, etc.
Jakub Pawlowicz [Sun, 13 Nov 2016 10:54:38 +0000 (11:54 +0100)]
Fixes all unit tests on top of the new tokenizer.
This involves the following changes too:
* /lib/selectors -> /lib/optimizer;
* new /lib/optimizer/tidy* modules for cleaning up tokens;
* redone URL rewriting as it doesn't require full document scan
anymore, as it's run right after tokenization;
* compatibility class is now a simple function;
* introducing `readSources` method instead of SourceReader class.
Jakub Pawlowicz [Sat, 5 Nov 2016 07:16:15 +0000 (08:16 +0100)]
Rewrites tokenizer without escaping.
This way it's much easier to handle parsing as it's a "one step"
process instead of way more complex, legacy escaping.
Jakub Pawlowicz [Mon, 12 Dec 2016 15:11:16 +0000 (16:11 +0100)]
Bumps online version to clean-css 3.4.22.
Jakub Pawlowicz [Mon, 12 Dec 2016 15:02:13 +0000 (16:02 +0100)]
Version 3.4.22 release notes.
Jakub Pawlowicz [Mon, 12 Dec 2016 13:12:22 +0000 (14:12 +0100)]
Ignores `@import` at-rules if after content.
Why:
* This is what browsers do and we should respect it.
Jakub Pawlowicz [Mon, 12 Dec 2016 12:57:06 +0000 (13:57 +0100)]
Fixes #841 - disabled importing and many files passed as array.
Why:
* Importing via `@shallow` feature should be propagated to next
files in the importing queue.
Jakub Pawlowicz [Wed, 16 Nov 2016 15:35:58 +0000 (16:35 +0100)]
Updates project description.
Why:
* To stress we have two platforms now.
Jakub Pawlowicz [Wed, 16 Nov 2016 11:01:13 +0000 (12:01 +0100)]
Bumps online version to clean-css 3.4.21.
Jakub Pawlowicz [Wed, 16 Nov 2016 10:51:53 +0000 (11:51 +0100)]
Version 3.4.21 release notes.
Jakub Pawlowicz [Wed, 16 Nov 2016 10:43:17 +0000 (11:43 +0100)]
Fixes #821 - edge case in reducing non-adjacent selectors.
Why:
* In case of previously optimized empty rules, the join positions
were not calculated correctly resulting in tokens being
incorrectly optimized.
Jakub Pawlowicz [Wed, 16 Nov 2016 07:36:12 +0000 (08:36 +0100)]
Fixes #830 - reordering border-* properties.
Why:
* `border-X` and `border-<side>-X` were reorderable but obiously one
cannot reorder them as that may change styling.
Jakub Pawlowicz [Tue, 15 Nov 2016 16:11:24 +0000 (17:11 +0100)]
Fixes #833 - moving `@media` queries.
Why:
* So it's not about `!important` modifier but `@` sign which were
incorrectly treated as a special marker starting a block.
* The solution is somewhat hacky - checking if a preceding character
is not a special marker - but an improved tokenizer will be there
soon (-ish).
Jakub Pawlowicz [Fri, 4 Nov 2016 15:11:15 +0000 (16:11 +0100)]
Adds page view Clicky tracking to GitHub page.
That's for page views only to figure out page usage.
Jakub Pawlowicz [Thu, 3 Nov 2016 20:14:50 +0000 (21:14 +0100)]
Disables keeping line break by default in UI.
Why:
* Mimics CLI and API default behavior.
Jakub Pawlowicz [Thu, 3 Nov 2016 19:37:49 +0000 (20:37 +0100)]
Ignores JSHint on /docs folder.
Why:
* JS on public pages don't follow the same conventions as the
rest of the repo.
Jakub Pawlowicz [Thu, 3 Nov 2016 19:27:23 +0000 (20:27 +0100)]
See #260 - hides template tag where it's not supported.
Jakub Pawlowicz [Thu, 3 Nov 2016 19:04:26 +0000 (20:04 +0100)]
See #260 - adds `noscript` warning.
Why:
* We need JavaScript to operate properly.
Jakub Pawlowicz [Thu, 3 Nov 2016 18:57:34 +0000 (19:57 +0100)]
See #260 - delays Worker initialization.
Why:
* There's no point fetching CleanCSS until files are about to be
optimized.
* It currently uses a fixed version of CleanCSS but we'll pass
version to initializer once more versions are supported.
Jakub Pawlowicz [Tue, 1 Nov 2016 07:56:21 +0000 (08:56 +0100)]
See #260 - adds UI for changing optimization settings.
Note: it disables advanced optimizations by default.
Why:
* To give users better control over how optimizations are applied.
Jakub Pawlowicz [Mon, 31 Oct 2016 21:02:51 +0000 (22:02 +0100)]
See #260 - shows short optimization summary.
Why:
* To let user know how much smaller output content is.
Jakub Pawlowicz [Mon, 31 Oct 2016 20:32:30 +0000 (21:32 +0100)]
See #260 - adds progress spinner.
Jakub Pawlowicz [Mon, 31 Oct 2016 20:23:59 +0000 (21:23 +0100)]
See #260 - adds worker error logging.
Why:
* At least there will be some feedback.
Jakub Pawlowicz [Mon, 31 Oct 2016 20:17:19 +0000 (21:17 +0100)]
See #260 - properly sets name of optimized file.
Jakub Pawlowicz [Mon, 31 Oct 2016 17:14:29 +0000 (18:14 +0100)]
See #260 - adds nicer look&feel for optimized files.
Jakub Pawlowicz [Mon, 31 Oct 2016 17:03:18 +0000 (18:03 +0100)]
See #260 - adds 'copy to clipboard' in UI.
Why:
* So user can copy optimized content without downloading a file.
Jakub Pawlowicz [Fri, 21 Oct 2016 16:05:00 +0000 (18:05 +0200)]
See #260 - adds a very basic browser client.
Why:
* So there's an easy way to minify files without installing
clean-css module;
vlakoff [Mon, 31 Oct 2016 21:32:26 +0000 (22:32 +0100)]
Add test when precision not castable to int
vlakoff [Sat, 29 Oct 2016 08:10:26 +0000 (10:10 +0200)]
Void if precision value is not a number
vlakoff [Sat, 29 Oct 2016 08:09:20 +0000 (10:09 +0200)]
Move cast into buildPrecision()
vlakoff [Sat, 29 Oct 2016 08:08:02 +0000 (10:08 +0200)]
Cast in options object rather than command line
vlakoff [Mon, 10 Oct 2016 17:50:50 +0000 (19:50 +0200)]
Note that rounding only applies to px values (#820)
Jakub Pawlowicz [Mon, 26 Sep 2016 04:48:08 +0000 (06:48 +0200)]
Version 3.4.20 release notes.
silverwind [Mon, 26 Sep 2016 04:36:31 +0000 (06:36 +0200)]
Prevent rules with :selection from being merged (#814)
Firefox does not support :selection, only :-moz-selection. This change
adds :selection to the list of problematic selectors to prevent invalid
rules from being created.
Also cleaned up the regex, : and :: are equivalent in this regex,
so reduced all section to just :.
Jakub Pawlowicz [Mon, 25 Jul 2016 04:31:28 +0000 (06:31 +0200)]
Version 3.4.19 release notes.
Jakub Pawlowicz [Mon, 25 Jul 2016 04:28:28 +0000 (06:28 +0200)]
Fixes #795 - `!important` and override compacting.
There was a broken test rule which didn't catch the bug, which is
now fixed.
Jakub Pawlowicz [Fri, 15 Jul 2016 18:07:18 +0000 (20:07 +0200)]
Bumps logo version.
Why:
* MaxCDN cached the previous one permanently based on URL.
So we need to change URL to point it to the new one.
Jakub Pawlowicz [Fri, 15 Jul 2016 17:49:58 +0000 (19:49 +0200)]
Adds a new, simpler droplet in our logo.
Jakub Pawlowicz [Tue, 12 Jul 2016 15:30:38 +0000 (17:30 +0200)]
Aligns all shapes in logo.
Jakub Pawlowicz [Tue, 12 Jul 2016 15:17:24 +0000 (17:17 +0200)]
Reimports logo.svg via Sketch.
Why:
* It's a SVG editor of choice;
* it will be easier to manage any future changes.
Jakub Pawlowicz [Tue, 12 Jul 2016 13:54:32 +0000 (15:54 +0200)]
Removes invisible "drop" from logo SVG file.
Jakub Pawlowicz [Tue, 12 Jul 2016 13:46:23 +0000 (15:46 +0200)]
Removes empty `<g>` nodes from logo SVG file.
Jakub Pawlowicz [Tue, 12 Jul 2016 13:43:04 +0000 (15:43 +0200)]
Cleans up Readme markup.
Jakub Pawlowicz [Tue, 12 Jul 2016 13:41:45 +0000 (15:41 +0200)]
Points Readme logo to canonical repository.
Sal Niro [Sun, 10 Jul 2016 09:40:27 +0000 (05:40 -0400)]
adding logo (#793)
Adds clean-css logo!
Jakub Pawlowicz [Wed, 15 Jun 2016 06:32:15 +0000 (08:32 +0200)]
Version 3.4.18 release notes.
Jakub Pawlowicz [Wed, 15 Jun 2016 06:23:29 +0000 (08:23 +0200)]
Fixes #787 - regression in data URI processing.
Yet another regression so we revert to the original order of
processing `url()` values.
Jakub Pawlowicz [Sat, 4 Jun 2016 06:07:14 +0000 (08:07 +0200)]
Version 3.4.17 release notes.
Jakub Pawlowicz [Sat, 4 Jun 2016 06:06:04 +0000 (08:06 +0200)]
See #783 - adds an extra test.
Jakub Pawlowicz [Sat, 4 Jun 2016 06:02:08 +0000 (08:02 +0200)]
Fixes #783 - regression in processing data URIs.
Jakub Pawlowicz [Thu, 2 Jun 2016 09:14:57 +0000 (11:14 +0200)]
Version 3.4.16 release notes.