Skip to content

Commit a6519f6

Browse files
committed
reinserted inlinecss dependency (I have no clue what I'm doing...)
1 parent cf54b85 commit a6519f6

File tree

4 files changed

+14
-9
lines changed

4 files changed

+14
-9
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
}
1313
],
1414
"require": {
15-
"symfony/css-selector": "^2.7|~3.0",
15+
"tijsverkoyen/css-to-inline-styles": "^2.2",
1616
"twig/twig": "^1.26"
1717
},
1818
"autoload": {

src/CssStore.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ class CssStore
1010
public function addCssStyle($cssRules)
1111
{
1212
$this->styles[] = $cssRules;
13+
return $this;
1314
}
1415

1516
public function getStyles()

src/PageSpecificCss.php

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@
33
namespace PageSpecificCss;
44

55
use TijsVerkoyen\CssToInlineStyles\Css\Processor;
6-
use TijsVerkoyen\CssToInlineStyles\Css\Rule\Rule;
76
use TijsVerkoyen\CssToInlineStyles\CssToInlineStyles;
87

98
class PageSpecificCss extends CssToInlineStyles
109
{
1110

12-
/**
13-
* @var CssStore
14-
*/
11+
/** @var CssStore */
1512
private $cssStore;
1613

14+
/** @var Processor */
15+
private $processor;
16+
1717
/**
1818
* PageSpecificCss constructor.
1919
*/
@@ -22,7 +22,7 @@ public function __construct()
2222
parent::__construct();
2323

2424
$this->cssStore = new CssStore();
25-
25+
$this->processor = new Processor(true);
2626
}
2727

2828
/**
@@ -40,7 +40,6 @@ public function processHtmlToStore($html)
4040
*/
4141
public function extractCss($html)
4242
{
43-
// Do something..
44-
return '';
43+
return $this->processor->getCssFromStyleTags($html);
4544
}
4645
}

src/Twig/TokenParsers/FoldTokenParser.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function parse(Twig_Token $token)
2323
{
2424
$lineno = $token->getLine();
2525
$this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE);
26-
$body = $this->parser->subparse([$this, 'decideJsEnd'], true);
26+
$body = $this->parser->subparse([$this, 'decideFoldEnd'], true);
2727
$this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE);
2828
return new FoldNode($body, [], $lineno, $this->getTag());
2929
}
@@ -37,4 +37,9 @@ public function getTag()
3737
{
3838
return 'fold';
3939
}
40+
41+
public function decideFoldEnd(Twig_Token $token)
42+
{
43+
return $token->test('endfold');
44+
}
4045
}

0 commit comments

Comments
 (0)