Skip to content

Commit e1b9e8d

Browse files
authored
Update README.md
1 parent 9e1c576 commit e1b9e8d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ composer require jandc/css-from-html-extractor
1212

1313
#### With Twig
1414
###### Register Extension
15-
```
15+
```php
1616
use 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+
```

0 commit comments

Comments
 (0)