I wrote this library in order to replicate how gmail renders emails. Basically they scope all the CSS for an email and then inject it into their document. Media queries, keyframes, fonts, elements, classes, and ids are all scoped and then selectors are converted so the email CSS only effects the email itself.Any feedback is greatly appreciated!
https://github.com/neurosnap/scopeify-html