Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mj-font tag generated HTML doesn't render webfonts on MacOS/iOS devices #1492

Closed
QuietSpecialist opened this issue Jan 17, 2019 · 7 comments
Closed

Comments

@QuietSpecialist
Copy link

Due to the addition of type="text/css" to the <link> tag, when using the mj-font shorthand tag, the generated HTML doesn't render webfonts on MacOS/iOS devices.

To reproduce

  1. Create a file with this MJML code:
<mjml>
  <mj-head>
    <mj-font href="https://fonts.googleapis.com/css?family=Source+Sans+Pro" name="Source Sans Pro" />
    <mj-attributes>
      <mj-all font-family="Source Sans Pro" />
    </mj-attributes>
  </mj-head>
  <mj-body>
    <mj-text font-size="72px">
      Hello World!
    </mj-text>
  </mj-body>
</mjml>
  1. Test generated code in Litmus (https://litmus.com)

Expected behaviour
The Source Sans Pro webfont should render. Instead the default email client font is used.

MJML environment

  • OS: MacOS
  • MJML Version: 4.1.2
  • MJML tool used: MJML App 2.10.0

Email sending environment (for rendering issues)

  • Platform used to send the email: n/a

Affected email clients (for rendering issues)

  • Apple Mail 10 (macOS 10.12)
  • iPad (Retina) (iOS 11.0)
  • iPad Mini (iOS 11.0)
  • iPhone 6s (iOS 10.3)
  • iPhone 6s Plus (iOS 10.3)
  • iPhone 7 (iOS 11.3.1)
  • iPhone 7 Plus (iOS 11.3.1)
  • iPhone SE (iOS 11.3.1)

Additional context
Whilst the type attribute is supported by the <link> tag, removing it results in the webfont rendering on MacOS/iOS devices with no impact on other email clients.

@iRyusa
Copy link
Member

iRyusa commented Jan 17, 2019 via email

@QuietSpecialist
Copy link
Author

Here you go…

Apple Mail 10 (macOS 10.12):

apple mail 10 macos 10 12

iPad (Retina) (iOS 11.0):

ipad retina ios 11 0

iPad Mini (iOS 11.0):

ipad mini ios 11 0

iPhone 6s (iOS 10.3):

iphone 6s ios 10 3

iPhone 6s Plus (iOS 10.3):

iphone 6s plus ios 10 3

Phone 7 (iOS 11.3.1):

iphone 7 ios 11 3 1

iPhone 7 Plus (iOS 11.3.1):

iphone 7 plus ios 11 3 1

iPhone SE (iOS 11.3.1):

iphone se ios 11 3 1

Appreciate this could be an issue with the Litmus servers.

@iRyusa
Copy link
Member

iRyusa commented Jan 18, 2019

Any chance that you're inlining your email on litmus ? That could lead to issue too 🤔
This is a screenshot on an actual device:
image

@iRyusa
Copy link
Member

iRyusa commented Jan 18, 2019

capture d ecran 2019-01-18 a 11 11 47

And here's Apple mail, no issue too 🤔

@QuietSpecialist
Copy link
Author

I'm not sure what "inlining your email on litmus" means? Is this a setting in Litmus you're referring to?

The font-family style is applied inline to the div tag but this has been auto generated by the MJML app.

@iRyusa
Copy link
Member

iRyusa commented Jan 18, 2019

I no longer use litmus, but there's a box somewhere where it can inline your styles for you, altering the html it might be that ?

@QuietSpecialist
Copy link
Author

Ah, can't see it. Might have been removed but I'm happy to close regardless.

Just run a test using an Email on Acid test account and can confirm it's working okay so going to assume this is a Litmus issue.

Thanks for looking into.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants