maizzle / framework

Quickly build HTML emails with Tailwind CSS.
https://maizzle.com
MIT License
1.2k stars 48 forks source link

Google font #1314

Closed rabeeaali closed 1 month ago

rabeeaali commented 1 month ago

I have added Google font as follows:

in tailwind.config.js:

fontFamily: {
        "ibm-plex-sans-arabic": ['"IBM Plex Sans Arabic"', "sans-serif"],
        "noto-sans-arabic": ['"Noto Sans Arabic"', "sans-serif"],
        zain: ["Zain", "sans-serif"],
      },

in main.html:

....
<if condition="page.title">
    <title>{{{ page.title }}}</title>
  </if>

  <link rel="preconnect" href="https://fonts.googleapis.com">
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
  <link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@300&family=Noto+Sans+Arabic:wght@300&family=Zain:wght@200;300;400;700;800;900&display=swap" rel="stylesheet">

  <style>
    {{{ page.css }}}
  </style>
.....

in otp.html:


<x-main>
  <div class="bg-slate-50 sm:px-4 font-zain">
  ....
</div>
</x-main>

in localhost, the font is working fine but when I deploy it on the server and send an email using Gmail the font does not work and take sans-serif