framix-team/skill-email-html-mjml / email-html-mjml
email-html-mjml
VerifiedResponsive HTML email template generation using MJML 5.x framework. Use when the user asks to create, generate, design, or build an email template — including welcome emails, promotional blasts, transactional templates, newsletters, or any responsive email. Also use when the user asks to compile MJML to HTML, work with or edit existing MJML templates or `.mjml` files, or troubleshoot email rendering issues across clients.
| File | Kind | Size |
|---|---|---|
| LICENSE | other | 1.0 KB |
| SKILL.md | skill md | 10.6 KB |
| assets/examples/basic-layout.mjml | other | 3.7 KB |
| assets/examples/newsletter.mjml | other | 5.0 KB |
| assets/examples/order-confirmation.mjml | other | 4.1 KB |
| assets/examples/partials/footer.mjml | other | 742 B |
| assets/examples/promo-sale.mjml | other | 5.6 KB |
| compilation.md | markdown | 5.2 KB |
| components/advanced.md | markdown | 6.0 KB |
| components/content.md | markdown | 5.1 KB |
| components/head.md | markdown | 3.2 KB |
| components/interactive.md | markdown | 8.0 KB |
| components/layout.md | markdown | 4.8 KB |
| mjml-reference.md | markdown | 8.5 KB |
components/head.md
View on GitHub# MJML Head Components Reference
## mj-attributes
Sets default attributes for components globally or by component type. Use to avoid repetitive inline styling.
```xml
<mj-head>
<mj-attributes>
<mj-all font-family="Arial, sans-serif" />
<mj-text padding="0" />
<mj-class name="hero-text" color="#ffffff" font-size="24px" />
</mj-attributes>
</mj-head>
```
- `<mj-all>` — applies attribute to every component
- `<mj-text padding="0" />` — overrides defaults for that component type
- `<mj-class name="foo" ... />` — named class, applied via `mj-class="foo"` on any component
Priority: inline attribute > mj-class > component default > mj-all
---
## mj-title
Sets the `<title>` tag and the `aria-label` on the body wrapper div (accessibility).
```xml
<mj-title>Your Email Subject or Title</mj-title>
```
---
## mj-preview
Sets the inbox preview text (visible in email client list before opening).
```xml
<mj-preview>Get 30% off this weekend only — shop now!</mj-preview>
```
No attributes. Content is plain text only.
---
## mj-font
Imports an external web font. Wraps import in MSO conditional comments so Outlook ignores it (preventing Times New Roman fallback). Always pair with a fallback font stack.
| Attribute | Accepts | Description |
|-----------|---------|-------------|
| name | string | Font name used in font-family |
| href | string | URL to hosted CSS file with @font-face |
```xml
<mj-font name="Raleway" href="https://fonts.googleapis.com/css?family=Raleway" />
<!-- Usage: font-family="Raleway, Arial, sans-serif" -->
```
**Outlook note**: Always include fallback fonts (Arial, sans-serif minimum). mj-font hides the @font-face from Outlook to prevent Times New Roman fallback.
---
## mj-breakpoint
Controls the width at which the layout switches from desktop to mobile view.
| Attribute | Accepts | Default |
|-----------|---------|---------|
| width | px | 480px |
MJML's own default breakpoint is **480px** — a template with no `<mj-breakpoint>` emits `@media only screen and (max-width:479px)`. This is unrelated to the 600px `mj-body` width.
```xml
<mj-breakpoint width="480px" />
```
---
## mj-style
Adds custom CSS. Use `inline="inline"` to force Juice inlining (required for Gmail compatibility).
| Attribute | Accepts | Description |
|-----------|---------|-------------|
| inline | "inline" | Inlines CSS via Juice during compilation |
```xml
<!-- Inlined — safe for Gmail -->
<mj-style inline="inline">
.dark-logo { display: none; }
</mj-style>
<!-- In <head> only — use sparingly -->
<mj-style>
@media (prefers-color-scheme: dark) {
.light-logo { display: none !important; }
.dark-logo { display: block !important; }
}
</mj-style>
```
**Gmail warning**: Gmail strips `<head>` CSS unless inlined. Critical layout styles must use component attributes, not CSS classes.
---
## mj-html-attributes
Adds custom HTML attributes (data-*, ARIA) to generated HTML elements via CSS selectors. Needed for editable templates or custom ARIA roles.
```xml
<mj-html-attributes>
<mj-selector path=".custom div">
<mj-html-attribute name="data-id">42</mj-html-attribute>
</mj-selector>
</mj-html-attributes>
```
Note: `mj-text` compiles to `<td class="..."><div>`. Target `.custom div` to reach the inner div.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation). | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK). | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |