jandc/critical-css-silex
Composer 安装命令:
composer require jandc/critical-css-silex
包简介
README 文档
README
Package, containing all the components to integrate generated automatic critical css into a silex 1.* project
Usage
Installation
composer require jandc/critical-css-silex
Registering the twig wrapper (with post processor) and twig extension
$app->register(new TwigWrapperProvider('twig', [new CriticalCssProcessor()])); $app->extend('twig', function (Twig_Environment $twig, $app) { $twig->addExtension(new CSSFromHTMLExtractor\Twig\Extension()); return $twig; });
Mark the regions of your templates with the provided blocks
{% fold %}
<div class="my-class">
...
</div>
{% endfold %}
Render your pages, using the twigwrapper
$app['twigwrapper']->render('@templates/my/template.twig', ['foo'=>'bar']);
统计信息
- 总下载量: 45
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2017-10-20