email/emailinlinestylestransformations
module
Functions
-
module:email/emailinlinestylestransformations~getEmailInlineStylesTransformations
Returns 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
align
attribute is only applied to thetable
and theimg
elements. - The
align
attribute is not applied to elements that already have it set. - The style attributes remain unchanged.
Returns
-