2017 © Pedro Peláez
 

library twig-inline-styles

Twig extension for represent the inline styles as an associative array

image

trzmaxim/twig-inline-styles

Twig extension for represent the inline styles as an associative array

  • Monday, October 5, 2015
  • by trzmaxim
  • Repository
  • 0 Watchers
  • 0 Stars
  • 19 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

twig-inline-styles

Twig extension for create and output inline styles, (*1)

Installation

Through Composer, (*2)

```{.sh} composer require "trzmaxim/twig-inline-styles": "dev-master", (*3)


```php 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), (*4)

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



, (*5)

Styles can be merged by .merge, (*6)

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

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

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

The Versions

05/10 2015

dev-master

9999999-dev

Twig extension for represent the inline styles as an associative array

  Sources   Download

MIT

The Requires

 

The Development Requires

by Maxim Gerasimov

twig css inline style