Automattic\WooCommerce\Vendor\Pelago\Emogrifier

CssInliner::addStyleElementToDocumentprotectedWC 1.0

Adds a style element with $css to $this->domDocument.

This method is protected to allow overriding.

Method of the class: CssInliner{}

No Hooks.

Returns

null. Nothing (null).

Usage

// protected - for code of main (parent) or child class
$result = $this->addStyleElementToDocument( $css ): void;
$css(string) (required)
.

Notes

CssInliner::addStyleElementToDocument() code WC 10.4.3

protected function addStyleElementToDocument(string $css): void
{
    $domDocument = $this->getDomDocument();
    $styleElement = $domDocument->createElement('style', $css);
    $styleAttribute = $domDocument->createAttribute('type');
    $styleAttribute->value = 'text/css';
    $styleElement->appendChild($styleAttribute);

    $headElement = $this->getHeadElement();
    $headElement->appendChild($styleElement);
}