email/emailinlinestylestransformations
module
Interfaces
module:email/emailinlinestylestransformations~EmailInlineStylesTransformationsOptions
Functions
getEmailInlineStylesTransformations( options ) → Array<ExportInlineStylesTransformation>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 width="100%"><tr><td align="center"><table style="..."></table></td></tr></table>
Note:
- The
alignattribute is only applied to theimgelements. - Tables aligned via margins are wrapped in a container table to ensure proper positioning in all email clients.
- The
alignattribute overrides any existing alignment attributes on these elements. - If the
floatandmarginare present, thefloatproperty takes precedence for alignment. - The style attributes remain unchanged.
Parameters
options : EmailInlineStylesTransformationsOptionsConfiguration options.
Defaults to
{}
Returns
Array<ExportInlineStylesTransformation>An array of transformations to be applied to style properties for email compatibility.