2017 © Pedro Peláez
 

library critical-css-processor

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

image

jandc/critical-css-processor

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

  • Sunday, January 22, 2017
  • by jandc
  • Repository
  • 1 Watchers
  • 0 Stars
  • 29 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 21 % 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

22/01 2017

dev-master

9999999-dev

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