File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ composer require jandc/css-from-html-extractor
1212
1313#### With Twig
1414###### Register Extension
15- ```
15+ ``` php
1616use CSSFromHTMLExtractor\Twig\Extension as ExtractorExtension;
1717
1818$extension = new ExtractorExtension()
@@ -22,7 +22,7 @@ $extension->addBaseRules('path/to/css');
2222$twig->addExtension($extension);
2323```
2424###### Mark the regions of your templates with the provided blocks
25- ```
25+ ``` twig
2626{% fold %}
2727<div class="my-class">
2828...
@@ -32,7 +32,7 @@ $twig->addExtension($extension);
3232
3333###### Retrieve the resulting css from the extension
3434
35- ```
35+ ``` php
3636$extension = $twigEnvironment->getExtension(ExtractorExtension::class);
3737$extension->buildCriticalCssFromSnippets();
3838```
@@ -44,4 +44,4 @@ $cssFromHTMLExtractor = new CssFromHTMLExtractor();
4444$cssFromHTMLExtractor->addBaseRules('path/to/css');
4545$cssFromHTMLExtractor->addHtmlToStore($rawHtml);
4646$extractedCss = $cssFromHTMLExtractor->buildExtractedRuleSet();
47- ```
47+ ```
You can’t perform that action at this time.
0 commit comments