Automattic\WooCommerce\Vendor\Pelago\Emogrifier
CssInliner::replaceUnmatchableNotComponent
Helps removeUnmatchablePseudoComponents() replace or remove a selector :not(...) component if its argument contains pseudo-elements or dynamic pseudo-classes.
Method of the class: CssInliner{}
No Hooks.
Returns
String . the full match if there were no unmatchable pseudo components within; otherwise, any preceding combinator followed by "*", or an empty string if there was no preceding combinator
Usage
// private - for code of main (parent) class only $result = $this->replaceUnmatchableNotComponent( $matches ): string;
- $matches(array) (required)
- .
CssInliner::replaceUnmatchableNotComponent() CssInliner::replaceUnmatchableNotComponent code WC 10.5.0
private function replaceUnmatchableNotComponent(array $matches): string
{
[$notComponentWithAnyPrecedingCombinator, $anyPrecedingCombinator, $notArgumentInBrackets] = $matches;
if ($this->hasUnsupportedPseudoClass($notArgumentInBrackets)) {
return $anyPrecedingCombinator !== '' ? $anyPrecedingCombinator . '*' : '';
}
return $notComponentWithAnyPrecedingCombinator;
}