fix: apply theme font size to email controls
This commit is contained in:
parent
a331c2bb56
commit
e2274c1ecb
@ -267,7 +267,7 @@ function emailBlock(block, data, theme) {
|
|||||||
case 'kpi':
|
case 'kpi':
|
||||||
return `<mj-text padding="${padding}" color="${theme.mutedColor}" container-background-color="${backgroundColor}">${escapeHtml(interpolate(p.label, data))}</mj-text><mj-text padding="0 ${padding} ${padding}" color="${color}" font-size="22px" font-weight="700" container-background-color="${backgroundColor}">${escapeHtml(interpolate(p.value, data))}</mj-text>`
|
return `<mj-text padding="${padding}" color="${theme.mutedColor}" container-background-color="${backgroundColor}">${escapeHtml(interpolate(p.label, data))}</mj-text><mj-text padding="0 ${padding} ${padding}" color="${color}" font-size="22px" font-weight="700" container-background-color="${backgroundColor}">${escapeHtml(interpolate(p.value, data))}</mj-text>`
|
||||||
case 'button':
|
case 'button':
|
||||||
return `<mj-button background-color="${safeHex(style.backgroundColor, theme.accentColor)}" color="${safeHex(style.textColor, theme.buttonTextColor)}" border-radius="${radius}px" href="${escapeHtml(safeUrl(p.url, data))}">${escapeHtml(interpolate(p.text, data))}</mj-button>`
|
return `<mj-button background-color="${safeHex(style.backgroundColor, theme.accentColor)}" color="${safeHex(style.textColor, theme.buttonTextColor)}" font-size="${theme.baseFontSize}px" border-radius="${radius}px" href="${escapeHtml(safeUrl(p.url, data))}">${escapeHtml(interpolate(p.text, data))}</mj-button>`
|
||||||
case 'image':
|
case 'image':
|
||||||
return `<mj-image padding="${padding}" border="${borderWidth}px solid ${borderColor}" border-radius="${radius}px" src="${escapeHtml(safeUrl(p.url, data))}" alt="${escapeHtml(interpolate(p.alt, data))}" />`
|
return `<mj-image padding="${padding}" border="${borderWidth}px solid ${borderColor}" border-radius="${radius}px" src="${escapeHtml(safeUrl(p.url, data))}" alt="${escapeHtml(interpolate(p.alt, data))}" />`
|
||||||
case 'divider':
|
case 'divider':
|
||||||
|
|||||||
@ -199,6 +199,7 @@ test('theme typography tokens drive email output', () => {
|
|||||||
},
|
},
|
||||||
blocks: [
|
blocks: [
|
||||||
{ type: 'heading', props: { text: 'Heading' } },
|
{ type: 'heading', props: { text: 'Heading' } },
|
||||||
|
{ type: 'text', props: { text: 'Body copy' } },
|
||||||
{ type: 'button', props: { text: 'Go', url: 'https://example.com' } }
|
{ type: 'button', props: { text: 'Go', url: 'https://example.com' } }
|
||||||
]
|
]
|
||||||
}, {})
|
}, {})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user