goetas/xhtml-clsss-to-styl

Convert CSS rules into local styles (HTML)

dev-master / 1.0.x-dev 2021-04-01 06:57 UTC

This package is auto-updated.

Last update: 2024-11-29 04:14:18 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