-
Notifications
You must be signed in to change notification settings - Fork 115
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
Thoughts on conditional comments #22
Comments
I'm interested in this as well! The email boilerplate hasn't been updated in a few years and both Campaign Monitor and MailChimp recommend the conditional comments. https://medium.com/cm-engineering/coding-mobile-first-emails-1513ac4673e#.ht6ccyt84 |
I've actually been playing around with making a react email templating system myself, and the biggest bottleneck for me so far has been the conditional comments due to React's lack of support for HTML comments. I haven't touched this in a while (it's a side project that I come back to when the time is there and inspiration strikes me), but I found a way to implement some comments: Edit: I just realized I should probably be using
Here's an implementation example from a button component I was working on:
I still need to abstract out the This limited by the fact that you need a wrapping HTML element in order for the comment to be applied. Plus, it doesn't handle nesting/composition very well; iirc, the last bump in the road that stopped my progress the last time I was working on this was the fact that abstracting any HTML commenting to a React component caused some problems with the the way the Comment component rendered items, which limited the React-like component uses you would want. Anyways, tossing this out there in case anyone else has any ideas! |
Im curious if you've given thought on how to handle the very common conditional comments for IE that are found in many email templates? I've been reading about the React/comment issue for a while and have not found anything useful for server side rendering.
The text was updated successfully, but these errors were encountered: