penthouse

Generate critical css for your web pages

MIT License

Downloads
138.5K
Stars
2.6K
Committers
34

Bot releases are visible (Hide)

penthouse - v0.8.4 - Fixes bug in dependency

Published by pocketjoso almost 9 years ago

Css containing multiple ::selector selector broke in the previous version, due to a bug in the apartment library.

penthouse - v.0.8.3 - memory leaks, strip out more

Published by pocketjoso almost 9 years ago

0.8.3

Previously undocumented earlier patch releases

v.0.8.2

v.0.8.1

penthouse - v.0.8.0 - abort js requests during critical css generation

Published by pocketjoso almost 9 years ago

Breaking change - js requests on page generating critical css for will no longer be executed. This could potentially strip out some css previously returned in critical css - but this css was if so never actually used during the first render.

Speeds up the critical css generation and uses less bandwidth.

See #92 for details.

penthouse - v.0.7.0 - remove unmatched media queries

Published by pocketjoso almost 9 years ago

Breaking change: min-width and min-height media queries with values greater than the specified viewport dimensions (by default 1300x900) are no longer returned in the critical css.

See #88 for details.

penthouse - v.0.6.0 - Remove long base64 encoded data values

Published by pocketjoso almost 9 years ago

See #87 and #86.

Breaking change: Now strips out embedded base64 encoded data values in css declarations if longer than 1000 characters - previously they were always kept. To get old behaviour back, just pass in maxEmbeddedBase64Length: 999999 (or some large enough number).

penthouse - v.0.5.0 - Fault tolerant css parsing

Published by pocketjoso almost 9 years ago

#85 Re-introduced fault tolerant css parsing, so that Penthouse can once again be relied upon even if your css contains errors.

Checks if the css contains errors, if not runs as usual. If it contains errors, passes it off to a phantomjs browser instance and then reads it back, in essence normalising the css. Has the side effects of creating webkit (Chrome) specific css, which is not currently restored to it's original in terms of vendor prefixes, browser hacks etc.

This normalising process also slows down Penthouse, so a strict flag has been added. With this flag set to true Penthouse will throw and return when encountering css errors, instead of going through the normalisation. Recommended to be used for development, but is by default set to false. Not yet documented.

penthouse - v.0.4.1 - forceInclude and timeout

Published by pocketjoso almost 9 years ago

penthouse - v.0.4.0 - AST parser in core

Published by pocketjoso almost 9 years ago

Replaces the internal logic in Penthouse for extracting critical css from full css. Penthouse now uses an ast parser for this purpose (this one), rather than regex matching on a css string.

No changes to any public apis, but one side effect of this release is that Penthouse is now less tolerant to invalid css. Invalid css is just stripped out, including f.e. all css inside a media query that is never closed. Both browsers and previous versions of Penthouse kept such css (albeit Penthouse's way of doing so was buggy) - so end effect now is that invalid css will now aways be missing in critical css. In the future I'll be looking into how to make the css parsing more fault tolerant again.

PR with full changes: https://github.com/pocketjoso/penthouse/pull/78

penthouse - 0.3.6 - Prevent crashes on special characters in CSS

Published by pocketjoso about 9 years ago

See #70 for details.

penthouse - 0.3.5

Published by pocketjoso about 9 years ago

Silence known phantomjs security errors going to stdout. Should not be needed in phantomjs 2.x.

penthouse - 0.3.4

Published by pocketjoso over 9 years ago

Supress errors from phantomjs on exit

Resolves https://github.com/pocketjoso/penthouse/issues/58

Specific fix for phantomjs 1.x chain - should no longer be needed in phantomjs 2.x.

penthouse - 0.3.2

Published by pocketjoso over 9 years ago

Simple change to provide more information when phantomjs fails to open an url.

penthouse - 0.3.1

Published by pocketjoso over 9 years ago

Added handling for @-moz-document; previously this at rule was just removed - but not it's content - which led to it leaking outside of the intended scope.

penthouse - 0.3.0

Published by pocketjoso over 9 years ago

Removal of print styles,
better internals, better modularisation, better tests.

Package Rankings
Top 1.1% on Npmjs.org
Top 6.75% on Proxy.golang.org
Badges
Extracted from project README
NPM version Build Status Downloads
Related Projects