Usage
The Spacer component is defined incomponents/spacer.html.
This enables the <x-spacer> syntax, which you can use like this:
<div>.
If you need to add space between <tr>, see the Row Spacer example instead.
Props
You can pass props to the component via HTML attributes, to control its height.height
Default:undefined
This will define the height of the Spacer.
You may use any CSS unit that you prefer, it doesn’t have to be px.
emails/example.html
emails/example.html
height is omitted, the Spacer will render as <div role="separator">‍</div>, which will render as an empty space that is as high as its parent element’s line-height.
mso-height
Default:undefined
Override the height of the Spacer in Outlook for Windows.
emails/example.html
mso-line-height-alt MSO CSS property to set a custom Spacer height in Outlook for Windows.
For the Spacer to work as expected in Outlook on Windows, it should also be styled with
mso-line-height-rule: exactly. In Maizzle this is set globally in the main.html layout, so you don’t need to worry about it.<head> might be stripped in some situations, simply add it in a style attribute on the tag:
emails/example.html
mso-line-height-rule-exactly class that is available from the tailwindcss-mso plugin (included in the Starter):
emails/example.html
components/spacer.html and add the mso-line-height-rule: exactly CSS rule to the <div> element.
Other attributes
You may pass any other HTML attributes to the component, such asclass or id.
Note that non-standard attributes will be ignored by default - you’ll need to define them as props in the component if you need them preserved. Alternatively, you can safelist them in your build.components config.
Responsive
To override the height of the Spacer on mobile, use theleading utilities in Tailwind CSS:
emails/example.html