Skip to content

🐛 Fixed newsletter and preview to support inlining pseudo css classes#12134

Merged
kevinansfield merged 1 commit into
TryGhost:masterfrom
jeremydavidson:master
Aug 18, 2020
Merged

🐛 Fixed newsletter and preview to support inlining pseudo css classes#12134
kevinansfield merged 1 commit into
TryGhost:masterfrom
jeremydavidson:master

Conversation

@jeremydavidson
Copy link
Copy Markdown
Contributor

@jeremydavidson jeremydavidson commented Aug 15, 2020

🐛 Fixed newsletter and preview to support inlining pseudo css classes

closes #12078

  • Root cause was that pseudo class .kg-bookmark-author:after was not getting inlined to email newsletter or its preview.
    • That is where the margin and bullet-point content are added between author and publisher.
  • Dependency juice supports an option inlinePseudoElements which is false by default.
  • Fix was to set inlinePseudoElements to true when serializing post email.

Got some code for us? Awesome 🎊!

Please include a description of your change & check your PR against this list, thanks!

  • There's a clear use-case for this code change
  • Commit message has a short title & references relevant issues
  • The build will pass (run yarn test and yarn lint)

More info can be found by clicking the "guidelines for contributing" link above.

closes TryGhost#12078
- Root cause was that pseudo class .kg-bookmark-author:after was not getting inlined to email newsletter or its preview.
  - That is where the margin and bullet-point content are added between author and publisher.
- Dependency juice supports an option inlinePseudoElements which is false by default.
- Fix was to set inlinePseudoElements to true when serializing post email.
@kevinansfield
Copy link
Copy Markdown
Member

kevinansfield commented Aug 16, 2020

Hey @jeremydavidson 👋 Thanks for looking into this. Unfortunately pseudo elements are not supported by the majority of email clients which is why it's disabled by default in juice, support is essentially only available in Apple Mail. Do you have any ideas for alternative fixes?

@jeremydavidson
Copy link
Copy Markdown
Contributor Author

jeremydavidson commented Aug 17, 2020

Hi @kevinansfield, what I learned juice can do in this solution is to transform pseudo classes into inline html, like it inlines css classes into style attributes. So, in this case, it transforms .kg-bookmark-author:after into a real html element that can render correctly in email clients: <span style="margin: 0 6px;">•</span>

@kevinansfield kevinansfield merged commit 681c96b into TryGhost:master Aug 18, 2020
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

Successfully merging this pull request may close these issues.

Spacing issues email/newsletter bookmark

2 participants