fix(body): user's margin summing with what's client-defined in the body #2637
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I was improving a few things on our copy-paste components, and I noticed that the margin defined in
react-email/apps/web/components/_components/layout.tsx
Line 53 in d4d9efd
was being applied to the inner
tdtag as per #2325, but, since the body by default in the browser has some margin, it was simply ignored, causing the body to actually have extra margins. Some email clients also apply this extra margin and resetting it here would be the expected behavior imo.Summary by cubic
Reset Body component margins to prevent double spacing when users set margin styles. This zeros the body’s margin while keeping user-defined margins on the content for consistent rendering across browsers and email clients.
Written for commit 2a23b6f. Summary will update automatically on new commits.