Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/plenty-carrots-bow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@react-email/editor": patch
---

Zeroed composed body margins
16 changes: 8 additions & 8 deletions packages/editor/src/extensions/container.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ describe('Container Node', () => {
@media (prefers-color-scheme: dark){li::marker{color:#c4c4c4}}
</style>
</head>
<body dir="ltr" lang="en" style="background-color:#ffffff">
<body dir="ltr" lang="en" style="background-color:#ffffff;margin:0;padding:0">
<!--$--><!--html--><!--head--><!--body-->
<table
border="0"
Expand All @@ -290,7 +290,7 @@ describe('Container Node', () => {
<td
dir="ltr"
lang="en"
style="font-family:-apple-system, BlinkMacSystemFont, &#x27;Segoe UI&#x27;, &#x27;Roboto&#x27;, &#x27;Oxygen&#x27;, &#x27;Ubuntu&#x27;, &#x27;Cantarell&#x27;, &#x27;Fira Sans&#x27;, &#x27;Droid Sans&#x27;, &#x27;Helvetica Neue&#x27;, sans-serif;font-size:1em;min-height:100%;line-height:155%;background-color:#ffffff">
style="margin:0;padding:0;font-family:-apple-system, BlinkMacSystemFont, &#x27;Segoe UI&#x27;, &#x27;Roboto&#x27;, &#x27;Oxygen&#x27;, &#x27;Ubuntu&#x27;, &#x27;Cantarell&#x27;, &#x27;Fira Sans&#x27;, &#x27;Droid Sans&#x27;, &#x27;Helvetica Neue&#x27;, sans-serif;font-size:1em;min-height:100%;line-height:155%;background-color:#ffffff">
<table
align="left"
width="100%"
Expand Down Expand Up @@ -1389,7 +1389,7 @@ describe('Container Node', () => {
@media (prefers-color-scheme: dark){li::marker{color:#c4c4c4}}
</style>
</head>
<body dir="ltr" lang="en">
<body dir="ltr" lang="en" style="margin:0;padding:0">
<!--$--><!--html--><!--head--><!--body-->
<table
border="0"
Expand All @@ -1403,7 +1403,7 @@ describe('Container Node', () => {
<td
dir="ltr"
lang="en"
style="font-family:-apple-system, BlinkMacSystemFont, &#x27;Segoe UI&#x27;, &#x27;Roboto&#x27;, &#x27;Oxygen&#x27;, &#x27;Ubuntu&#x27;, &#x27;Cantarell&#x27;, &#x27;Fira Sans&#x27;, &#x27;Droid Sans&#x27;, &#x27;Helvetica Neue&#x27;, sans-serif;font-size:14px;min-height:100%;line-height:155%">
style="margin:0;padding:0;font-family:-apple-system, BlinkMacSystemFont, &#x27;Segoe UI&#x27;, &#x27;Roboto&#x27;, &#x27;Oxygen&#x27;, &#x27;Ubuntu&#x27;, &#x27;Cantarell&#x27;, &#x27;Fira Sans&#x27;, &#x27;Droid Sans&#x27;, &#x27;Helvetica Neue&#x27;, sans-serif;font-size:14px;min-height:100%;line-height:155%">
<table
align="center"
width="100%"
Expand Down Expand Up @@ -1507,7 +1507,7 @@ describe('Container Node', () => {
@media (prefers-color-scheme: dark){li::marker{color:#c4c4c4}}
</style>
</head>
<body dir="ltr" lang="en">
<body dir="ltr" lang="en" style="margin:0;padding:0">
<!--$--><!--html--><!--head--><!--body-->
<table
border="0"
Expand All @@ -1521,7 +1521,7 @@ describe('Container Node', () => {
<td
dir="ltr"
lang="en"
style="font-family:-apple-system, BlinkMacSystemFont, &#x27;Segoe UI&#x27;, &#x27;Roboto&#x27;, &#x27;Oxygen&#x27;, &#x27;Ubuntu&#x27;, &#x27;Cantarell&#x27;, &#x27;Fira Sans&#x27;, &#x27;Droid Sans&#x27;, &#x27;Helvetica Neue&#x27;, sans-serif;font-size:14px;min-height:100%;line-height:155%">
style="margin:0;padding:0;font-family:-apple-system, BlinkMacSystemFont, &#x27;Segoe UI&#x27;, &#x27;Roboto&#x27;, &#x27;Oxygen&#x27;, &#x27;Ubuntu&#x27;, &#x27;Cantarell&#x27;, &#x27;Fira Sans&#x27;, &#x27;Droid Sans&#x27;, &#x27;Helvetica Neue&#x27;, sans-serif;font-size:14px;min-height:100%;line-height:155%">
<table
align="left"
width="100%"
Expand Down Expand Up @@ -1593,7 +1593,7 @@ describe('Container Node', () => {
@media (prefers-color-scheme: dark){li::marker{color:#c4c4c4}}
</style>
</head>
<body dir="ltr" lang="en" style="background-color:#ffffff">
<body dir="ltr" lang="en" style="background-color:#ffffff;margin:0;padding:0">
<!--$--><!--html--><!--head--><!--body-->
<table
border="0"
Expand All @@ -1607,7 +1607,7 @@ describe('Container Node', () => {
<td
dir="ltr"
lang="en"
style="font-family:-apple-system, BlinkMacSystemFont, &#x27;Segoe UI&#x27;, &#x27;Roboto&#x27;, &#x27;Oxygen&#x27;, &#x27;Ubuntu&#x27;, &#x27;Cantarell&#x27;, &#x27;Fira Sans&#x27;, &#x27;Droid Sans&#x27;, &#x27;Helvetica Neue&#x27;, sans-serif;font-size:1em;min-height:100%;line-height:155%;background-color:#ffffff">
style="margin:0;padding:0;font-family:-apple-system, BlinkMacSystemFont, &#x27;Segoe UI&#x27;, &#x27;Roboto&#x27;, &#x27;Oxygen&#x27;, &#x27;Ubuntu&#x27;, &#x27;Cantarell&#x27;, &#x27;Fira Sans&#x27;, &#x27;Droid Sans&#x27;, &#x27;Helvetica Neue&#x27;, sans-serif;font-size:1em;min-height:100%;line-height:155%;background-color:#ffffff">
<table
align="left"
width="100%"
Expand Down
10 changes: 9 additions & 1 deletion packages/editor/src/plugins/email-theming/extension.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,15 @@ export const EmailTheming = Extension.create<{
<Preview>{previewText}</Preview>
)}

<Body style={mergedStyles.body}>{children}</Body>
<Body

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is the right appraoch here. Should these just maybe be part of the default theme instead?

style={{
margin: 0,
padding: 0,
...mergedStyles.body,
}}
>
{children}
</Body>
</Html>
);
},
Expand Down
Loading