mizmoz.com / mmm-lang
The markup language for creating emails and pages in Mizmoz.
This is an early version and is likely to be subject to significant changes to the API - you've be warned!
Features
- mmm markup rendering to HTML for email and HTML for web
- Components for creating layouts (
Row
,Column
,Divider
)
Components
Row
Block level row element which is a container for any number of Column
components.
<!-- Simple single column layout --> Hello world!
attribute | description | default value [options] |
---|---|---|
background-color |
row background color | #ffffff |
center-on-mobile |
center the content on mobile | true |
content-width |
row width | 600px |
full-width |
is the row 100% iof the page | false |
padding |
column padding | 0px |
spacing |
position of column spacing | none [none, inside, outside, both] |
spacing-color |
column spacing color | |
spacing-width |
column spacing width | 0px |
Column
Inline block element representing a column. Must be a child of Row
.
By default the Row
will calculate the column widths and pass them at render time.
<!-- Two column layout, each with 50% width --> Hello world! Hello world!
attribute | description | default value [options] |
---|---|---|
background-color |
background color | row background color |
center-on-mobile |
center the content on mobile | true |
padding |
column padding | 0px |
width |
column width | 100% |
The width can either be empty, in which case width = row width / number of columns
Fractions can also be used like width="1/4"
Box
Block level container which helps to recreate the browser box model
<!-- Text with consistent padding and margins --> Hello world! Hello world!
attribute | description | default value [options] |
---|---|---|
align |
box alignment | initial |
background-color |
background color | |
border-radius |
box border radius | 0 |
margin |
box margin | 0px |
padding |
padding padding | 0px |
width |
width | auto |
height |
height | auto |
Button
Block level button
attribute | description | default value [options] |
---|---|---|
align |
button alignment | center |
background-color |
background color | #5db734 |
border-radius |
box border radius | 3px |
box-shadow |
button drop shadow | none [none, subtle, dark, css box-shadow: ... |
color |
button color | #ffffff |
font-family |
font family for the button | inherit |
font-size |
font size | 14px |
margin |
margin | 0px |
padding |
padding | 12px |
width |
width | auto |
text |
button label | Click me |
url |
url | |
width |
button width | auto |
Divider
Block level divider which can be used as a horzontal rule or more often just as a spacer to achieve pixel perfect padding.
attribute | description | default value [options] |
---|---|---|
color |
divider color | #ffffff |
margin |
margin | 0px |
height |
divider height | 100% |
width |
divider width | 100% |
Image
Block level image element. All images are fluid by default with the width
attribute | description | default value [options] |
---|---|---|
align |
image alignment | center |
alt |
image alt tag | |
padding |
column padding | 0px |
src |
url to the image | |
url |
url to link to | |
height |
max height | 100% |
width |
max width | 100% |
Roadmap & Development
Phase 1
- MMM parser
- Rendering engine (the basic renderer)
- Email HTML engine (for creating email HTML output)
- Website HTML engine
Template Engine
Row
container element forColumn
Column
componentBox
container to recreate the browser box model consistentlyDivider
used to create spacing between elements
Rendering Order
- Parse
mmm > mmm-head > mmm-merge
to makeMerge
tags available to the rest of the template - Parse and resolve all merge tags leaving in place any that don't resolve.
This is so
user.*
&live.*
tags aren't replaced - Render
mmm > mmm-body > *
components - Render
mmm > mmm-head > *
components - Inline CSS rules
Email Gotchas
- p tags should be replaced with tables with all styles applied to the td element (Outlook 07,10,12)
- replace margin with Margin
Welcome to my website 2016-12-24 00:00:00 Menu Welcome {{user.firstname}} to this email! {{name}}