goetas/xhtml-clsss-to-styl

Convert CSS rules into local styles (HTML)

dev-master / 1.0.x-dev 2019-08-27 15:09 UTC

This package is auto-updated.

Last update: 2020-01-27 15:58:49 UTC


README

Convert CSS rules into local styles (HTML)

Example

use Goetas\XhtmlClassToStyle\XhtmlClassToStyle;

$dom = new \DOMDocument("1.0", "UTF-8");
$dom->loadXML("myhtml.html");

$api = new XhtmlClassToStyle();
$api->applyCss($dom, file_get_contents("style.css"));

echo $dom->saveXML(); // all classes of style.css will be transformed into local styles