i have issue regarding apply in line css in email template.

it's showing following error in my email template

CSS inlining error: Warning: DOMXPath::query(): Invalid expression in /var/www/magento2/public_html/vendor/pelago/emogrifier/Classes/Emogrifier.php on line 269 

i also update pelago reference link but no luck.


I got solution perfect solution, you need to update

Line 595,

 $search = array(
            // get rid of css comment code
            // strip out any import directives
            // strip remains media enclosures

        $replace = array(

found a solution for Magento 2

created the files




in my custom theme and added the content from



/vendor/magento/theme-frontend-blank/web/css/email-inline.css respectively

Please Note below

but each with the line "@import 'source/_theme.less';" commented out (or removed)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.