CSS Inliner Rewriter - adobe/aem-core-email-components GitHub Wiki

Takes the HTML output of the page and inlines all CSS in as HTML attributes:

  • Rewrite the output to move every CSS ruleset to the targeted elements as an HTML style attribute.
    • Properly handle quotes, like: font-family: 'Timmana', "Gill Sans", sans-serif;
    • Accept also browser-specific rules, like: -ms-interpolation-mode: bicubic;
    • Preserve duplicate properties, like: display: inline-block; display: block;
    • Preserve capitalization as-is, like: Margin: 0px;
  • Keep the original style element in the HTML as-is in order to:
    • Preserve media queries, web fonts, and animations by not removing from the style element any “@” declaration.
    • Preserve unmatched CSS rules, like the Outlook .ExternalClass class name.
    • Preserve CSS pseudo-selectors, like a:hover or p::before.
  • Leave client-specific comments untouched, like:
    <!--[if mso]><style>.hide-mso { display: none; }</style><![endif]-->
⚠️ **GitHub.com Fallback** ⚠️