2017 © Pedro Peláez
 

library css-from-html-extractor

Php library which determines which css is used from html snippets.

image

jandc/css-from-html-extractor

Php library which determines which css is used from html snippets.

  • Tuesday, April 17, 2018
  • by jandc
  • Repository
  • 3 Watchers
  • 2 Stars
  • 4,762 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 2 Forks
  • 1 Open issues
  • 25 Versions
  • 38 % Grown

The README.md

CSS from HTML extractor

Php library which determines which css is used from html snippets. It is used in jandc/critical-css to automatically and dynamically determine critical css on a per page basis., (*1)

Installation

composer require jandc/css-from-html-extractor, (*2)

Usage

With Twig

Register Extension
use CSSFromHTMLExtractor\Twig\Extension as ExtractorExtension;

$extension = new ExtractorExtension()
$extension->addBaseRules('path/to/css');

/** @var Twig_Environment $twig */
$twig->addExtension($extension);
Mark the regions of your templates with the provided blocks
{% fold %}


...
{% endfold %}
Retrieve the resulting css from the extension
$extension = $twigEnvironment->getExtension(ExtractorExtension::class);
$extension->buildCriticalCssFromSnippets();

Handling raw HTML

$cssFromHTMLExtractor = new CssFromHTMLExtractor();
$cssFromHTMLExtractor->addBaseRules('path/to/css');
$cssFromHTMLExtractor->addHtmlToStore($rawHtml);
$extractedCss = $cssFromHTMLExtractor->buildExtractedRuleSet();

The Versions

17/04 2018

dev-master

9999999-dev https://github.com/JanDC/css-from-html-extractor

Php library which determines which css is used from html snippets.

  Sources   Download

ISC

The Requires

 

17/04 2018

1.1.3

1.1.3.0 https://github.com/JanDC/css-from-html-extractor

Php library which determines which css is used from html snippets.

  Sources   Download

ISC

The Requires

 

13/03 2018

1.1.2

1.1.2.0 https://github.com/JanDC/css-from-html-extractor

Php library which determines which css is used from html snippets.

  Sources   Download

ISC

The Requires

 

13/03 2018

dev-ignore-improper-selectors

dev-ignore-improper-selectors https://github.com/JanDC/css-from-html-extractor

Php library which determines which css is used from html snippets.

  Sources   Download

ISC

The Requires

 

04/03 2018

1.1.1

1.1.1.0 https://github.com/JanDC/css-from-html-extractor

Php library which determines which css is used from html snippets.

  Sources   Download

ISC

The Requires

 

03/03 2018

dev-performance-optimizations

dev-performance-optimizations https://github.com/JanDC/css-from-html-extractor

Php library which determines which css is used from html snippets.

  Sources   Download

ISC

The Requires

 

03/03 2018

1.1

1.1.0.0 https://github.com/JanDC/css-from-html-extractor

Php library which determines which css is used from html snippets.

  Sources   Download

ISC

The Requires

 

02/03 2018

1.0.8

1.0.8.0 https://github.com/JanDC/css-from-html-extractor

Php library which determines which css is used from html snippets.

  Sources   Download

ISC

The Requires

 

22/11 2017

1.0.7

1.0.7.0 https://github.com/JanDC/css-from-html-extractor

Php library which determines which css is used from html snippets.

  Sources   Download

ISC

The Requires

 

22/11 2017

1.0.6

1.0.6.0 https://github.com/JanDC/css-from-html-extractor

Php library which determines which css is used from html snippets.

  Sources   Download

ISC

The Requires

 

22/11 2017

1.0.5

1.0.5.0 https://github.com/JanDC/css-from-html-extractor

Php library which determines which css is used from html snippets.

  Sources   Download

ISC

The Requires

 

21/10 2017

1.0.4

1.0.4.0 https://github.com/JanDC/css-from-html-extractor

Php library which determines which css is used from html snippets.

  Sources   Download

ISC

The Requires

 

21/10 2017

1.0.3

1.0.3.0 https://github.com/JanDC/css-from-html-extractor

Php library which determines which css is used from html snippets.

  Sources   Download

ISC

The Requires

 

20/10 2017

1.0.2

1.0.2.0 https://github.com/JanDC/css-from-html-extractor

Php library which determines which css is used from html snippets.

  Sources   Download

ISC

The Requires

 

20/10 2017

1.0.1

1.0.1.0 https://github.com/JanDC/css-from-html-extractor

Php library which determines which css is used from html snippets.

  Sources   Download

ISC

The Requires

 

20/10 2017

1.0

1.0.0.0 https://github.com/JanDC/css-from-html-extractor

Php library which determines which css is used from html snippets.

  Sources   Download

ISC

The Requires

 

19/10 2017

0.3.3

0.3.3.0 https://github.com/JanDC/page-specific-css

Php library which determines critical css on a per page basis.

  Sources   Download

ISC

The Requires

 

04/10 2017

0.3.2

0.3.2.0 https://github.com/JanDC/page-specific-css

Php library which determines critical css on a per page basis.

  Sources   Download

ISC

The Requires

 

04/10 2017

0.3.0.1

0.3.0.1 https://github.com/JanDC/page-specific-css

Php library which determines critical css on a per page basis.

  Sources   Download

ISC

The Requires

 

04/10 2017

0.3.1

0.3.1.0 https://github.com/JanDC/page-specific-css

Php library which determines critical css on a per page basis.

  Sources   Download

ISC

The Requires

 

02/10 2017

0.3

0.3.0.0 https://github.com/JanDC/page-specific-css

Php library which determines critical css on a per page basis.

  Sources   Download

ISC

The Requires

 

26/01 2017

0.2.2

0.2.2.0 https://github.com/JanDC/page-specific-css

Php library which determines critical css on a per page basis.

  Sources   Download

ISC

The Requires

 

22/01 2017

0.2.1

0.2.1.0 https://github.com/JanDC/page-specific-css

Php library which determines critical css on a per page basis.

  Sources   Download

ISC

The Requires

 

28/11 2016

0.2

0.2.0.0 https://github.com/JanDC/page-specific-css

Php library which determines critical css on a per page basis.

  Sources   Download

ISC

The Requires

 

27/10 2016

0.1

0.1.0.0 https://github.com/JanDC/page-specific-css

Php library which determines critical css on a per page basis.

  Sources   Download

ISC

The Requires