Automattic\WooCommerce\Vendor\Pelago\Emogrifier

CssInliner::removeUnsupportedOfTypePseudoClassesprivateWC 1.0

Removes any ...-of-type pseudo-classes from part of a CSS selector, if it does not have a type, replacing them with "*" if necessary.

Method of the class: CssInliner{}

No Hooks.

Returns

String . selector part which will match the relevant DOM elements if the pseudo-classes are assumed to apply

Usage

// private - for code of main (parent) class only
$result = $this->removeUnsupportedOfTypePseudoClasses( $selectorPart ): string;
$selectorPart(string) (required)
part of a selector which has been split up at combinators.

CssInliner::removeUnsupportedOfTypePseudoClasses() code WC 10.5.0

private function removeUnsupportedOfTypePseudoClasses(string $selectorPart): string
{
    if (!$this->selectorPartHasUnsupportedOfTypePseudoClass($selectorPart)) {
        return $selectorPart;
    }

    return $this->removeSelectorComponents(
        ':(?:' . self::OF_TYPE_PSEUDO_CLASS_MATCHER . ')(?:\\([^\\)]*+\\))?+',
        $selectorPart
    );
}