R
R
romaro2021-10-08 12:56:41
Building projects
romaro, 2021-10-08 12:56:41

How to inject styles from classes when assembling an HTML email template?

I need to compose letters for mailing lists, and it is desirable to specify inline styles in them. Is it possible to replace classes in the HTML/EGS template with the styles of this class? For example, I write in the template: There is a class (can be connected to the template or be registered in it):
<p class="style-font">

.style-font {
  color: red;
  padding-top:0;
}


After assembly, you should get HTML, in which all classes are replaced by styles: Something like mixins in the template itself. I'm sure there is already a solution...
<p style="color:red; padding-top:0;">

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Yarkov, 2021-10-08
@yarkov

https://www.npmjs.com/package/inline-css

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question