Automattic\WooCommerce\Vendor\Pelago\Emogrifier\HtmlProcessor
CssToAttributeConverter::mapCssToHtmlAttributes
Applies $styles to $node.
This method maps CSS styles to HTML attributes and adds those to the node.
Method of the class: CssToAttributeConverter{}
No Hooks.
Returns
null. Nothing (null).
Usage
// private - for code of main (parent) class only $result = $this->mapCssToHtmlAttributes( $styles, $node ): void;
- $styles(array) (required)
- .
- $node(DOMElement) (required)
- node to apply styles to.
CssToAttributeConverter::mapCssToHtmlAttributes() CssToAttributeConverter::mapCssToHtmlAttributes code WC 10.8.1
private function mapCssToHtmlAttributes(array $styles, \DOMElement $node): void
{
foreach ($styles as $property => $value) {
// Strip !important indicator
$value = \trim(\str_replace('!important', '', $value));
$this->mapCssToHtmlAttribute($property, $value, $node);
}
}