Download the PHP package northys/css-inliner without Composer
On this page you can find all versions of the php package northys/css-inliner. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download northys/css-inliner
More information about northys/css-inliner
Files in northys/css-inliner
Package css-inliner
Short Description PHP Library that converts css file into html inline styles.
License LGPL
Rated 5.00 based on 1 reviews
Informations about the package css-inliner
CSS-Inliner
CSS-Inliner is simple PHP tools that inserts CSS from file into HTML style attributes. Nothing more, nothing less.
I tried to make it as fast as possible, but due to third party libraries I can't do more.
Anyway, this tools wasn't created for inlining CSS files of bambilions lines (hey, Bootstrap - of course you can inline it, but you will have enough time to make a coffee), but for inlining styles into e-mails. So I hope it will do its job for you and helps you with creating newsletters, sending notification mails and so on.
Usage
Installation using composer
Add northys/css-inliner to your composer.json. It is necessary to install this tools using composer. Otherwise you will need to download another libs manually.
Requirements
Example code
Method addCSS()
accepts file path to the CSS file however render()
accepts html content.
If you would like to know why, here is the reason for you - there are tons of templating system like Nette\Latte
or Smarty
and sometimes you will need to use this tool on code that those libs generated.
Input
Output
Or run it with node
-
Install dependencies
- Run
A file myResult.html will be genereted in templates/example.
Your .html and .css files must be the same name of your template path. See an example in https://github.com/alisonmonteiro/CSS-Inliner/tree/master/templates