npm.io
5.4.0 • Published 1 month ago

mjml-head-font

Licence
MIT
Version
5.4.0
Deps
3
Size
4 kB
Vulns
0
Weekly
0
Stars
18.2K

mj-font

Imports external fonts and is only applied if the template uses the font.

The href attribute should point to a hosted CSS file that contains a @font-face declaration, for example: https://fonts .googleapis.com/css?family=Raleway

<mjml>
  <mj-head>
    <mj-font name="Raleway"
      href="https://fonts.googleapis.com/css?family=Raleway" />
  </mj-head>
  <mj-body>
    <mj-section>
      <mj-column>
        <mj-text font-family="Raleway, Arial">
          Hello World!
        </mj-text>
      </mj-column>
     </mj-section>
  </mj-body>
</mjml>

Attributes

attribute accepts description default value
href string URL of a hosted CSS file
name string name of the font

Try it live