Generate critical css for your web pages
MIT License
Bot releases are hidden (Show)
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.
Published by pocketjoso almost 9 years ago
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.
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.
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).
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.
Published by pocketjoso almost 9 years ago
forceInclude
option, handling string
and RegExp
values - https://github.com/pocketjoso/penthouse/pull/64
timeout
option, to abort Penthouse after a certain time - https://github.com/pocketjoso/penthouse/pull/73
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
Published by pocketjoso about 9 years ago
See #70 for details.
Published by pocketjoso about 9 years ago
Silence known phantomjs security errors going to stdout. Should not be needed in phantomjs 2.x
.
Published by pocketjoso over 9 years ago
Resolves https://github.com/pocketjoso/penthouse/issues/58
Specific fix for phantomjs 1.x
chain - should no longer be needed in phantomjs 2.x
.
Published by pocketjoso over 9 years ago
Simple change to provide more information when phantomjs
fails to open an url.
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.
Published by pocketjoso over 9 years ago
Removal of print styles,
better internals, better modularisation, better tests.