@comet/agent-features 9.0.0-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +24 -0
- package/package.json +19 -0
- package/rules/coding-guidelines/api-nestjs.instructions.md +107 -0
- package/rules/coding-guidelines/cdn.instructions.md +24 -0
- package/rules/coding-guidelines/general.instructions.md +30 -0
- package/rules/coding-guidelines/git.instructions.md +37 -0
- package/rules/coding-guidelines/kubernetes.instructions.md +59 -0
- package/rules/coding-guidelines/libraries.instructions.md +34 -0
- package/rules/coding-guidelines/naming.instructions.md +39 -0
- package/rules/coding-guidelines/postgresql.instructions.md +40 -0
- package/rules/coding-guidelines/react.instructions.md +102 -0
- package/rules/coding-guidelines/security.instructions.md +44 -0
- package/rules/coding-guidelines/styling.instructions.md +50 -0
- package/rules/coding-guidelines/typescript.instructions.md +50 -0
- package/skills/.gitkeep +0 -0
- package/skills/comet-block/SKILL.md +246 -0
- package/skills/comet-block/references/admin-patterns.md +192 -0
- package/skills/comet-block/references/api-patterns.md +183 -0
- package/skills/comet-block/references/block-loader.md +368 -0
- package/skills/comet-block/references/block-types.md +210 -0
- package/skills/comet-block/references/custom-block-field.md +266 -0
- package/skills/comet-block/references/fixtures.md +436 -0
- package/skills/comet-block/references/image.md +341 -0
- package/skills/comet-block/references/migration.md +597 -0
- package/skills/comet-block/references/registration.md +167 -0
- package/skills/comet-block/references/response-summary.md +102 -0
- package/skills/comet-block/references/rich-text.md +309 -0
- package/skills/comet-block/references/select.md +176 -0
- package/skills/comet-block/references/site-patterns.md +202 -0
- package/skills/comet-mail-react/SKILL.md +541 -0
- package/skills/comet-mail-react/references/components-and-theme.md +441 -0
- package/skills/comet-mail-react/references/layout-patterns.md +315 -0
- package/skills/comet-mail-react/references/styling-and-customization.md +306 -0
- package/skills/comet-minor-update/SKILL.md +191 -0
- package/skills/dev-pm/SKILL.md +100 -0
|
@@ -0,0 +1,441 @@
|
|
|
1
|
+
# Components & Theme Reference
|
|
2
|
+
|
|
3
|
+
Detailed reference for all `@comet/mail-react` components, the theme system, module augmentation, and scoped theming.
|
|
4
|
+
|
|
5
|
+
## Table of Contents
|
|
6
|
+
|
|
7
|
+
1. [Theme Structure & Defaults](#theme-structure--defaults)
|
|
8
|
+
2. [Module Augmentation Interfaces](#module-augmentation-interfaces)
|
|
9
|
+
3. [MjmlMailRoot](#mjmlmailroot)
|
|
10
|
+
4. [MjmlSection](#mjmlsection)
|
|
11
|
+
5. [MjmlWrapper](#mjmlwrapper)
|
|
12
|
+
6. [Text Components](#text-components)
|
|
13
|
+
7. [HtmlInlineLink](#htmlinlinelink)
|
|
14
|
+
8. [Image](#image)
|
|
15
|
+
9. [Divider](#divider)
|
|
16
|
+
10. [Scoped Theming](#scoped-theming)
|
|
17
|
+
11. [MJML Component Re-exports](#mjml-component-re-exports)
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Theme Structure & Defaults
|
|
22
|
+
|
|
23
|
+
`createTheme(overrides?)` merges partial overrides into the default theme:
|
|
24
|
+
|
|
25
|
+
| Path | Default | Description |
|
|
26
|
+
| --------------------------- | ----------------------------- | ----------------------------------------------------------- |
|
|
27
|
+
| `sizes.bodyWidth` | `600` | Email container width in pixels |
|
|
28
|
+
| `sizes.contentIndentation` | `{ default: 32, mobile: 16 }` | Left/right padding when `indent` is used |
|
|
29
|
+
| `breakpoints.default` | `createBreakpoint(bodyWidth)` | Auto-set to body width unless explicitly overridden |
|
|
30
|
+
| `breakpoints.mobile` | `createBreakpoint(420)` | Mobile breakpoint (`max-width: 419px`) |
|
|
31
|
+
| `text.fontFamily` | System default | Base font family |
|
|
32
|
+
| `text.fontSize` | `"16px"` | Base font size |
|
|
33
|
+
| `text.lineHeight` | `"20px"` | Base line height |
|
|
34
|
+
| `text.bottomSpacing` | `"16px"` | Default spacing below text when `bottomSpacing` prop is set |
|
|
35
|
+
| `text.defaultVariant` | `undefined` | Variant applied when no `variant` prop is specified |
|
|
36
|
+
| `text.variants` | `{}` | Named typography presets |
|
|
37
|
+
| `colors.background.body` | `"#F2F2F2"` | Email body background |
|
|
38
|
+
| `colors.background.content` | `"#FFFFFF"` | Section content background |
|
|
39
|
+
|
|
40
|
+
### Breakpoints
|
|
41
|
+
|
|
42
|
+
Breakpoint values are created with `createBreakpoint(pixelWidth)`:
|
|
43
|
+
|
|
44
|
+
```ts
|
|
45
|
+
createBreakpoint(420);
|
|
46
|
+
// → { value: 420, belowMediaQuery: "@media (max-width: 419px)" }
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
The `belowMediaQuery` string is ready to use in `registerStyles` calls.
|
|
50
|
+
|
|
51
|
+
### Responsive Values
|
|
52
|
+
|
|
53
|
+
Many theme properties accept responsive values — objects keyed by breakpoint name:
|
|
54
|
+
|
|
55
|
+
```ts
|
|
56
|
+
const theme = createTheme({
|
|
57
|
+
sizes: {
|
|
58
|
+
contentIndentation: { default: 40, tablet: 30, mobile: 20 },
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
The `default` key provides the base value (rendered inline). Other keys generate media query overrides automatically.
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## Module Augmentation Interfaces
|
|
68
|
+
|
|
69
|
+
These interfaces are empty by default, designed for consumers to extend via `declare module`. Place augmentations in your theme file alongside `createTheme()`, generally below the `createTheme` call.
|
|
70
|
+
|
|
71
|
+
### TextVariants
|
|
72
|
+
|
|
73
|
+
Controls the `variant` prop on `MjmlText` and `HtmlText`:
|
|
74
|
+
|
|
75
|
+
```ts
|
|
76
|
+
const theme = createTheme({
|
|
77
|
+
text: {
|
|
78
|
+
defaultVariant: "body",
|
|
79
|
+
variants: {
|
|
80
|
+
heading: { fontSize: "32px", fontWeight: 700, lineHeight: "40px" },
|
|
81
|
+
body: { fontSize: "16px", lineHeight: "24px" },
|
|
82
|
+
caption: { fontSize: "12px", lineHeight: "16px", color: "#666666" },
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
declare module "@comet/mail-react" {
|
|
88
|
+
interface TextVariants {
|
|
89
|
+
heading: true;
|
|
90
|
+
body: true;
|
|
91
|
+
caption: true;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Variant properties accept responsive values:
|
|
97
|
+
|
|
98
|
+
```ts
|
|
99
|
+
heading: {
|
|
100
|
+
fontSize: { default: "32px", mobile: "24px" },
|
|
101
|
+
lineHeight: { default: "40px", mobile: "30px" },
|
|
102
|
+
bottomSpacing: { default: "24px", mobile: "16px" },
|
|
103
|
+
fontWeight: 700,
|
|
104
|
+
},
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### DividerVariants
|
|
108
|
+
|
|
109
|
+
Controls the `variant` prop on `MjmlDivider` and `HtmlDivider`:
|
|
110
|
+
|
|
111
|
+
```ts
|
|
112
|
+
const theme = createTheme({
|
|
113
|
+
divider: {
|
|
114
|
+
defaultVariant: "thin",
|
|
115
|
+
variants: {
|
|
116
|
+
thin: { height: 1, backgroundColor: "#999999" },
|
|
117
|
+
thick: { height: { default: 12, mobile: 8 }, backgroundColor: "#222222" },
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
declare module "@comet/mail-react" {
|
|
123
|
+
interface DividerVariants {
|
|
124
|
+
thin: true;
|
|
125
|
+
thick: true;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
Variant properties (`height`, `backgroundColor`, `backgroundImage`) accept responsive values.
|
|
131
|
+
|
|
132
|
+
### ThemeBreakpoints
|
|
133
|
+
|
|
134
|
+
Built-in keys are `default` and `mobile`. Add custom breakpoints:
|
|
135
|
+
|
|
136
|
+
```ts
|
|
137
|
+
import { createBreakpoint, type ThemeBreakpoint } from "@comet/mail-react";
|
|
138
|
+
|
|
139
|
+
const theme = createTheme({
|
|
140
|
+
breakpoints: { tablet: createBreakpoint(540) },
|
|
141
|
+
sizes: {
|
|
142
|
+
contentIndentation: { default: 40, tablet: 30, mobile: 20 },
|
|
143
|
+
},
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
declare module "@comet/mail-react" {
|
|
147
|
+
interface ThemeBreakpoints {
|
|
148
|
+
tablet: ThemeBreakpoint;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
New breakpoint keys automatically become available in all responsive theme values.
|
|
154
|
+
|
|
155
|
+
### ThemeBackgroundColors and ThemeColors
|
|
156
|
+
|
|
157
|
+
Add project-specific color tokens:
|
|
158
|
+
|
|
159
|
+
```ts
|
|
160
|
+
const theme = createTheme({
|
|
161
|
+
colors: {
|
|
162
|
+
background: { highlight: "#FFF3CD", footer: "#1A1A2E" },
|
|
163
|
+
brand: { primary: "#0066CC", secondary: "#004499" },
|
|
164
|
+
},
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
declare module "@comet/mail-react" {
|
|
168
|
+
interface ThemeBackgroundColors {
|
|
169
|
+
highlight: string;
|
|
170
|
+
footer: string;
|
|
171
|
+
}
|
|
172
|
+
interface ThemeColors {
|
|
173
|
+
brand: { primary: string; secondary: string };
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
## MjmlMailRoot
|
|
181
|
+
|
|
182
|
+
Root element for every email template. Renders the full MJML skeleton (`<mjml>`, `<mj-head>`, `<mj-body>`) and provides the theme to all descendant components.
|
|
183
|
+
|
|
184
|
+
**Props:**
|
|
185
|
+
|
|
186
|
+
| Prop | Type | Default | Description |
|
|
187
|
+
| ---------- | ----------- | --------------- | --------------------------------------------------------- |
|
|
188
|
+
| `theme` | `Theme` | `createTheme()` | Theme for the email |
|
|
189
|
+
| `config` | `Config` | — | Augmentable values exposed to descendants via `useConfig` |
|
|
190
|
+
| `children` | `ReactNode` | — | Email content |
|
|
191
|
+
|
|
192
|
+
**What it configures from the theme:**
|
|
193
|
+
|
|
194
|
+
- Body width from `theme.sizes.bodyWidth`
|
|
195
|
+
- Body background from `theme.colors.background.body`
|
|
196
|
+
- MJML breakpoint from `theme.breakpoints.mobile` (controls when columns stack)
|
|
197
|
+
- Base font family from `theme.text.fontFamily`
|
|
198
|
+
- Zero default padding on all components
|
|
199
|
+
- Renders all registered styles (`registerStyles`) in the `<head>`
|
|
200
|
+
|
|
201
|
+
**In Storybook:** the decorator wraps stories automatically — pass a custom theme via `parameters.theme`. **Outside Storybook:** wrap content in `MjmlMailRoot` yourself.
|
|
202
|
+
|
|
203
|
+
---
|
|
204
|
+
|
|
205
|
+
## MjmlSection
|
|
206
|
+
|
|
207
|
+
Full-width horizontal row with theme integration.
|
|
208
|
+
|
|
209
|
+
**Props** (in addition to standard MJML section props):
|
|
210
|
+
|
|
211
|
+
| Prop | Type | Default | Description |
|
|
212
|
+
| --------------------------- | ------------------------------------- | --------------------------------- | ------------------------------------------------------------------------------- |
|
|
213
|
+
| `indent` | `boolean` | `false` | Applies theme-based left/right padding |
|
|
214
|
+
| `disableResponsiveBehavior` | `boolean` | `false` | Prevents columns from stacking on mobile |
|
|
215
|
+
| `slotProps` | `{ group?: Partial<MjmlGroupProps> }` | — | Forward props to internal `MjmlGroup` (when `disableResponsiveBehavior` is set) |
|
|
216
|
+
| `backgroundColor` | `string` | `theme.colors.background.content` | Override section background color |
|
|
217
|
+
|
|
218
|
+
**CSS classes:** `.mjmlSection`, `.mjmlSection--indented` (when `indent` is set).
|
|
219
|
+
|
|
220
|
+
```tsx
|
|
221
|
+
<MjmlSection indent>
|
|
222
|
+
<MjmlColumn><MjmlText>Indented content</MjmlText></MjmlColumn>
|
|
223
|
+
</MjmlSection>
|
|
224
|
+
|
|
225
|
+
<MjmlSection disableResponsiveBehavior slotProps={{ group: { width: "100%" } }}>
|
|
226
|
+
<MjmlColumn><MjmlText>Won't stack</MjmlText></MjmlColumn>
|
|
227
|
+
<MjmlColumn><MjmlText>on mobile</MjmlText></MjmlColumn>
|
|
228
|
+
</MjmlSection>
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
Indentation values come from `theme.sizes.contentIndentation`, which supports responsive values.
|
|
232
|
+
|
|
233
|
+
**Inside `MjmlWrapper`:** the theme-default `backgroundColor` is suppressed so the wrapper's background shows through. An explicit `backgroundColor` prop still wins.
|
|
234
|
+
|
|
235
|
+
---
|
|
236
|
+
|
|
237
|
+
## MjmlWrapper
|
|
238
|
+
|
|
239
|
+
Groups multiple `MjmlSection`s that share a background. Must be a direct child of `MjmlBody`; sections go inside.
|
|
240
|
+
|
|
241
|
+
**Props** (standard MJML wrapper props):
|
|
242
|
+
|
|
243
|
+
| Prop | Type | Default | Description |
|
|
244
|
+
| ----------------- | ----------- | --------------------------------- | --------------------------------------------------------------------- |
|
|
245
|
+
| `backgroundColor` | `string` | `theme.colors.background.content` | Background applied to the whole wrapper; shows through inner sections |
|
|
246
|
+
| `children` | `ReactNode` | — | Sections to group |
|
|
247
|
+
|
|
248
|
+
When a theme is present, `MjmlWrapper` applies `theme.colors.background.content` as its default `backgroundColor`. Inner `MjmlSection`s suppress their own theme-default background so the wrapper's color is visible; an explicit `backgroundColor` prop on an inner section still wins.
|
|
249
|
+
|
|
250
|
+
```tsx
|
|
251
|
+
<MjmlWrapper backgroundColor="#dddddd">
|
|
252
|
+
<MjmlSection indent>
|
|
253
|
+
<MjmlColumn>
|
|
254
|
+
<MjmlText>First row</MjmlText>
|
|
255
|
+
</MjmlColumn>
|
|
256
|
+
</MjmlSection>
|
|
257
|
+
<MjmlSection indent>
|
|
258
|
+
<MjmlColumn>
|
|
259
|
+
<MjmlText>Second row</MjmlText>
|
|
260
|
+
</MjmlColumn>
|
|
261
|
+
</MjmlSection>
|
|
262
|
+
</MjmlWrapper>
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
Typical uses: multi-section footers with their own color, or grouping sections behind a shared outer padding (e.g., the `direction="rtl"` workaround in [`layout-patterns.md`](layout-patterns.md)). For a region that also needs different default text color or variants, combine `MjmlWrapper` with a scoped `ThemeProvider` — see Scoped Theming below.
|
|
266
|
+
|
|
267
|
+
---
|
|
268
|
+
|
|
269
|
+
## Text Components
|
|
270
|
+
|
|
271
|
+
### MjmlText
|
|
272
|
+
|
|
273
|
+
MJML text component — use inside `MjmlColumn` following the standard layout model.
|
|
274
|
+
|
|
275
|
+
**Props** (in addition to standard MJML text props):
|
|
276
|
+
|
|
277
|
+
| Prop | Type | Description |
|
|
278
|
+
| --------------- | -------------------- | ----------------------------------------- |
|
|
279
|
+
| `variant` | `keyof TextVariants` | Named typography preset from theme |
|
|
280
|
+
| `bottomSpacing` | `boolean` | Add spacing below (from theme or variant) |
|
|
281
|
+
|
|
282
|
+
**CSS classes:** `.mjmlText`, `.mjmlText--{variant}`, `.mjmlText--bottomSpacing`.
|
|
283
|
+
|
|
284
|
+
```tsx
|
|
285
|
+
<MjmlText variant="heading" bottomSpacing>Large heading with spacing</MjmlText>
|
|
286
|
+
<MjmlText variant="body">Regular body text</MjmlText>
|
|
287
|
+
<MjmlText>Uses defaultVariant if set in theme</MjmlText>
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
Variant styles merge on top of base theme text styles — properties not set by the variant inherit from the base.
|
|
291
|
+
|
|
292
|
+
### HtmlText
|
|
293
|
+
|
|
294
|
+
Themed text for use inside ending tags (`MjmlText`, `MjmlRaw`) or custom HTML structures where MJML components can't be used. Renders a plain HTML element.
|
|
295
|
+
|
|
296
|
+
**Props:**
|
|
297
|
+
|
|
298
|
+
| Prop | Type | Default | Description |
|
|
299
|
+
| --------------- | -------------------- | ------- | ---------------------- |
|
|
300
|
+
| `variant` | `keyof TextVariants` | — | Typography preset |
|
|
301
|
+
| `bottomSpacing` | `boolean` | `false` | Add spacing below |
|
|
302
|
+
| `element` | `string` | `"td"` | HTML element to render |
|
|
303
|
+
|
|
304
|
+
**CSS classes:** `.htmlText`, `.htmlText--{variant}`, `.htmlText--bottomSpacing`.
|
|
305
|
+
|
|
306
|
+
```tsx
|
|
307
|
+
<MjmlRaw>
|
|
308
|
+
<table>
|
|
309
|
+
<tr>
|
|
310
|
+
<HtmlText variant="body">Themed text inside a raw table</HtmlText>
|
|
311
|
+
</tr>
|
|
312
|
+
</table>
|
|
313
|
+
</MjmlRaw>
|
|
314
|
+
|
|
315
|
+
<MjmlText>
|
|
316
|
+
<HtmlText element="div" variant="caption">Rendered as a div</HtmlText>
|
|
317
|
+
</MjmlText>
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
### Bottom Spacing
|
|
321
|
+
|
|
322
|
+
Use `bottomSpacing` to add consistent vertical spacing below text elements:
|
|
323
|
+
|
|
324
|
+
```tsx
|
|
325
|
+
<MjmlText bottomSpacing>First paragraph with spacing below</MjmlText>
|
|
326
|
+
<MjmlText bottomSpacing>Second paragraph with spacing below</MjmlText>
|
|
327
|
+
<MjmlText>Last paragraph, no extra spacing</MjmlText>
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
The base spacing value comes from `theme.text.bottomSpacing`. Variants can override it individually with their own `bottomSpacing` property (which also supports responsive values).
|
|
331
|
+
|
|
332
|
+
---
|
|
333
|
+
|
|
334
|
+
## HtmlInlineLink
|
|
335
|
+
|
|
336
|
+
`<a>` element for use inside `MjmlText` or `HtmlText`. Inherits parent's font styles — even on Outlook Desktop, which normally overrides link typography with its own defaults.
|
|
337
|
+
|
|
338
|
+
**Props:** Standard `<a>` props. Defaults to `target="_blank"` and `text-decoration: underline`.
|
|
339
|
+
|
|
340
|
+
**CSS class:** `.htmlInlineLink`.
|
|
341
|
+
|
|
342
|
+
```tsx
|
|
343
|
+
<MjmlText variant="body">
|
|
344
|
+
Visit our <HtmlInlineLink href="https://example.com">website</HtmlInlineLink> for more.
|
|
345
|
+
</MjmlText>
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
### Outlook Workaround
|
|
349
|
+
|
|
350
|
+
Outlook Desktop ignores `<style>` blocks and applies its own "Hyperlink" style to `<a>` tags, overriding inherited CSS. `HtmlInlineLink` counters this by setting explicit inline styles for font properties (sourced from the parent text component's context). On modern clients, a responsive CSS reset ensures the link adapts when responsive variant overrides apply.
|
|
351
|
+
|
|
352
|
+
### Custom Color
|
|
353
|
+
|
|
354
|
+
Use `!important` when setting a custom link color — the responsive reset uses `inherit !important`, which would otherwise take precedence:
|
|
355
|
+
|
|
356
|
+
```tsx
|
|
357
|
+
<HtmlInlineLink href="https://example.com" style={{ color: "#0066cc !important" }}>
|
|
358
|
+
link text
|
|
359
|
+
</HtmlInlineLink>
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
---
|
|
363
|
+
|
|
364
|
+
## Image
|
|
365
|
+
|
|
366
|
+
`MjmlImage` and `HtmlImage` are responsive — the image scales down to fit narrow viewports.
|
|
367
|
+
|
|
368
|
+
**CSS classes:** `.mjmlImage`, `.htmlImage`.
|
|
369
|
+
|
|
370
|
+
## Divider
|
|
371
|
+
|
|
372
|
+
Themed horizontal line, styled from `theme.divider` (base styles plus variants). Falls back to a built-in default when no theme is in scope; only `variant` requires a theme.
|
|
373
|
+
|
|
374
|
+
- **`MjmlDivider`** — inside `MjmlColumn`. Classes `.mjmlDivider`, `.mjmlDivider--{variant}`.
|
|
375
|
+
- **`HtmlDivider`** — inside ending tags (`MjmlRaw`) or raw HTML. Classes `.htmlDivider`, `.htmlDivider--{variant}`.
|
|
376
|
+
|
|
377
|
+
```tsx
|
|
378
|
+
<MjmlDivider variant="thick" />
|
|
379
|
+
```
|
|
380
|
+
|
|
381
|
+
---
|
|
382
|
+
|
|
383
|
+
## Scoped Theming
|
|
384
|
+
|
|
385
|
+
`ThemeProvider` applies a different theme to a subtree. Common use: dark-background sections.
|
|
386
|
+
|
|
387
|
+
**Prefer `MjmlWrapper` when only the background color changes.** Reach for `ThemeProvider` when text color, variants, or other theme values also need to differ — cloning a theme is overkill for a background-only change.
|
|
388
|
+
|
|
389
|
+
```tsx
|
|
390
|
+
import { ThemeProvider } from "@comet/mail-react";
|
|
391
|
+
import { theme } from "./theme";
|
|
392
|
+
|
|
393
|
+
const darkSectionTheme = {
|
|
394
|
+
...theme,
|
|
395
|
+
colors: {
|
|
396
|
+
...theme.colors,
|
|
397
|
+
background: {
|
|
398
|
+
...theme.colors.background,
|
|
399
|
+
content: "#1A1A2E",
|
|
400
|
+
},
|
|
401
|
+
},
|
|
402
|
+
text: {
|
|
403
|
+
...theme.text,
|
|
404
|
+
color: "#FFFFFF",
|
|
405
|
+
},
|
|
406
|
+
};
|
|
407
|
+
|
|
408
|
+
function EmailWithDarkFooter() {
|
|
409
|
+
return (
|
|
410
|
+
<>
|
|
411
|
+
<MjmlSection indent>
|
|
412
|
+
<MjmlColumn>
|
|
413
|
+
<MjmlText>Regular content</MjmlText>
|
|
414
|
+
</MjmlColumn>
|
|
415
|
+
</MjmlSection>
|
|
416
|
+
|
|
417
|
+
<ThemeProvider theme={darkSectionTheme}>
|
|
418
|
+
<MjmlSection indent>
|
|
419
|
+
<MjmlColumn>
|
|
420
|
+
<MjmlText>Dark footer with white text</MjmlText>
|
|
421
|
+
</MjmlColumn>
|
|
422
|
+
</MjmlSection>
|
|
423
|
+
</ThemeProvider>
|
|
424
|
+
</>
|
|
425
|
+
);
|
|
426
|
+
}
|
|
427
|
+
```
|
|
428
|
+
|
|
429
|
+
`ThemeProvider` **replaces** the theme — it does not merge with the parent. Spread the root theme and override only what needs to change to preserve settings like font family, variants, and breakpoints.
|
|
430
|
+
|
|
431
|
+
Theme-aware `registerStyles` entries always resolve against the **root theme** from `MjmlMailRoot`, not nested `ThemeProvider` scopes.
|
|
432
|
+
|
|
433
|
+
---
|
|
434
|
+
|
|
435
|
+
## MJML Component Re-exports
|
|
436
|
+
|
|
437
|
+
`@comet/mail-react` re-exports all MJML components from `@faire/mjml-react`. Consumers import everything from `@comet/mail-react` — never from `@faire/mjml-react` directly.
|
|
438
|
+
|
|
439
|
+
Common re-exports: `MjmlColumn`, `MjmlButton`, `MjmlSpacer`, `MjmlTable`, `MjmlRaw`, `MjmlGroup`, `MjmlAttributes`, `MjmlAll`, `MjmlClass`, `MjmlStyle`, `MjmlComment`, `MjmlConditionalComment`.
|
|
440
|
+
|
|
441
|
+
For the full MJML tag reference: https://documentation.mjml.io/
|