email/emailinlinestylestransformations
module
Functions
module:email/emailinlinestylestransformations~getEmailInlineStylesTransformationsReturns a collection of style property transformations designed for email compatibility.
These transformations convert modern CSS styles into HTML attributes better supported by email clients. The transformations focus on converting alignment-related CSS properties into corresponding HTML attributes.
Examples of transformations:
Float to align:
<img style="float: left">→<img align="left">
Shorthand margin for centering:
<table style="margin: auto"></table>→<table style="..." align="center"></table><table style="margin: 10px auto"></table>→<table style="..." align="center"></table>
Note:
- The
alignattribute is only applied to thetableand theimgelements. - The
alignattribute is not applied to elements that already have it set. - The style attributes remain unchanged.
Returns