trzmaxim/twig-inline-styles 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

trzmaxim/twig-inline-styles

Composer 安装命令:

composer require trzmaxim/twig-inline-styles

包简介

Twig extension for represent the inline styles as an associative array

README 文档

README

Twig extension for create and output inline styles

Installation

Through Composer

composer require "trzmaxim/twig-inline-styles": "dev-master"
use TrzMaxim\TwigInlineStyles\InlineStylesExtension;

$twig = new Twig_Environment(...);

$twig->addExtension(new InlineStylesExtension());

Usage

Styles are presented in the form of a hash. Style keys are camelCase, vendor prefix must begin with a capital letter (WebkitTransition). The value is a string or a number to the number of automatically adds the line "points", but there are exceptions (see)

{% style foo {
  fontSize: 12,
  color: 'red'
} %}

<p style="{{ foo }}"></p>

Styles can be merged by .merge

{% style foo {
  fontSize: 12,
  color: 'red'
} %}

{% style bar {
  color: 'green',
  padding: '10px 0',
} %}

{{ foo.merge(bar) }} {# font-size:12px;color:green;padding:10px 0; #}

统计信息

  • 总下载量: 50
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-10-04