undercloud/inlinecss

PHP Stylesheet Generator

dev-master 2016-04-09 21:22 UTC

This package is auto-updated.

Last update: 2024-04-28 06:18:45 UTC


README

Inline CSS Generator

##Install composer require undercloud/inlinecss

##Basic example

require 'vendor/autoload.php';

$css = new \Undercloud\InlineCss;

$css->color      = '#282828';
$css->lineHeight = 1.5;
$css->fontSize   = '36px';

echo '<h1 style="' . $css . '">Hello I\'m inline CSS</h1>';

or

echo '<style>' . $css('h1') . '</style>';

##Predefined properties

$css = new \Undercloud\InlineCss(
	array(
		'textAlign' => 'left',
		'display'   => 'inline-block',
		'position'  => 'relative'
	)
);

##Values For adding values use object assign

$css->color = '#282828';

or use function add

$css->add('color', '#282828');