I've not changed the core header.html which is in the vendor directory.

According to the Magento 2 dev docs, I must create "email-inline.less" in app/design/MyVendor/MyTheme/web/css directory, however, the styles are not being applied to the sent email.

I'm wondering if email-inline.less file will be compiled automatically or I have to compile it first to the css file? I've actually made seperate email-inline.css file, but styles were not working with this one too.


4 Answers 4


The file name should have an underscore prefix: _email-inline.less
After writing your styles you should remove static files

rm -rf var/view_preprocessed/* pub/static/*

Please add email-inline.css instead of email-inline.less on



Please try to add important on your custom css changes because if Magento default CSS priority before your CSS in that case you changes not reflected so please check with important.

Here is example for you reference.

background-color: red !important; 

Hope it will work for you!


Please add your css in _email.less file. Below is the file path.


If _email.less is not exists on this file then copy it from the parent theme.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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