2017 © Pedro Peláez
 

library critical-css

Package wrapper and twig postprocessor class which uses the 'css from html extractor' library and twigwrapper to inject a document's head with critical css

image

jandc/critical-css

Package wrapper and twig postprocessor class which uses the 'css from html extractor' library and twigwrapper to inject a document's head with critical css

  • Saturday, March 3, 2018
  • by jandc
  • Repository
  • 4 Watchers
  • 19 Stars
  • 4,752 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 20 Versions
  • 38 % Grown

The README.md

Critical CSS

PHP library for generating critical CSS., (*1)

critical css banner, (*2)

Features

  • PHP only, no Node.js required.
  • Automatically generated for each page
  • Manual control through {% fold %}{% endfold %} tags
  • Dynamically resolves CSS used on each page

Site(s) using Critical CSS

  • https://www.farmaline.be/apotheek/

Installation

composer require jandc/critical-css, (*3)

Register the twig extension and create a wrapper instance with the critical CSS processor
 use TwigWrapper\TwigWrapper;
 use CriticalCssProcessor\CriticalCssProcessor;

 $twigEnvironment->addExtension(new CSSFromHTMLExtractor\Twig\Extension());
 $twigWrapper = new TwigWrapper($twigEnvironment, [new CriticalCssProcessor()]);
 ```
##### Mark the regions of your templates with the provided blocks
```twig
{% fold %}


...
{% endfold %}
Render your pages, using the twigwrapper

php $twigWrapper->render('@templates/my/template.twig', ['foo'=>'bar']);, (*4)

Available implementations

If you have your own implementation, please send a pull request to add it to this list., (*5)

The Versions

03/03 2018

dev-master

9999999-dev

Package wrapper and twig postprocessor class which uses the 'css from html extractor' library and twigwrapper to inject a document's head with critical css

  Sources   Download

MIT

The Requires

 

03/03 2018

0.6.1

0.6.1.0

Package wrapper and twig postprocessor class which uses the 'css from html extractor' library and twigwrapper to inject a document's head with critical css

  Sources   Download

MIT

The Requires

 

03/03 2018

0.6.0

0.6.0.0

Package wrapper and twig postprocessor class which uses the 'css from html extractor' library and twigwrapper to inject a document's head with critical css

  Sources   Download

MIT

The Requires

 

02/03 2018

0.5.6

0.5.6.0

Package wrapper and twig postprocessor class which uses the 'css from html extractor' library and twigwrapper to inject a document's head with critical css

  Sources   Download

MIT

The Requires

 

02/03 2018

0.5.5

0.5.5.0

Package wrapper and twig postprocessor class which uses the 'css from html extractor' library and twigwrapper to inject a document's head with critical css

  Sources   Download

MIT

The Requires

 

10/01 2018

0.5.4

0.5.4.0

Package wrapper and twig postprocessor class which uses the 'css from html' library and twigwrapper to inject a document's head with critical css

  Sources   Download

MIT

The Requires

 

10/01 2018

0.5.3

0.5.3.0

Package wrapper and twig postprocessor class which uses the 'css from html' library and twigwrapper to inject a document's head with critical css

  Sources   Download

MIT

The Requires

 

10/12 2017

0.5.2

0.5.2.0

Package wrapper and twig postprocessor class which uses the 'css from html' library and twigwrapper to inject a document's head with critical css

  Sources   Download

MIT

The Requires

 

22/10 2017

0.5.1

0.5.1.0

Package wrapper and twig postprocessor class which uses the 'css from html' library and twigwrapper to inject a document's head with critical css

  Sources   Download

MIT

The Requires

 

21/10 2017

0.5

0.5.0.0

Package wrapper and twig postprocessor class which uses the 'css from html' library and twigwrapper to inject a document's head with critical css

  Sources   Download

MIT

The Requires

 

21/10 2017

0.4.3

0.4.3.0

Package wrapper and twig postprocessor class which uses the 'css from html' library and twigwrapper to inject a document's head with critical css

  Sources   Download

MIT

The Requires

 

21/10 2017

0.4.2

0.4.2.0

Package wrapper and twig postprocessor class which uses the 'css from html' library and twigwrapper to inject a document's head with critical css

  Sources   Download

MIT

The Requires

 

20/10 2017

0.4.1

0.4.1.0

Package wrapper and twig postprocessor class which uses the 'css from html' library and twigwrapper to inject a document's head with critical css

  Sources   Download

MIT

The Requires

 

20/10 2017

0.4

0.4.0.0

Package wrapper and twig postprocessor class which uses the 'css from html' library and twigwrapper to inject a document's head with critical css

  Sources   Download

MIT

The Requires

 

03/10 2017

0.3

0.3.0.0

Twig postprocessor class which uses the the page-specific-css library to inject the document's head with css

  Sources   Download

MIT

The Requires

 

22/01 2017

0.2.2

0.2.2.0

Twig postprocessor class which uses the the page-specific-css library to inject the document's head with css

  Sources   Download

MIT

The Requires

 

21/01 2017

0.2.1

0.2.1.0

Twig postprocessor class which uses the the page-specific-css library to inject the document's head with css

  Sources   Download

MIT

The Requires

 

21/01 2017

0.2

0.2.0.0

Twig postprocessor class which uses the the page-specific-css library to inject the document's head with css

  Sources   Download

MIT

The Requires

 

23/11 2016

0.1.1

0.1.1.0

Twig postprocessor class which uses the the page-specific-css library to inject the document's head with css

  Sources   Download

MIT

The Requires

 

23/11 2016

0.1

0.1.0.0

Twig postprocessor class which uses the the page-specific-css library to inject the document's head with css

  Sources   Download

MIT

The Requires