fix: remove logic modifying inbound email CSS for padding.#438
Open
maxhaomh wants to merge 1 commit into
Open
Conversation
Member
|
maybe making this a setting but completely removing is not a option |
Contributor
Author
|
Mind explaining what the original design decisions behind the css
modification logic? Maybe there is something I am missing.
But blindingly assuming all emails with <style> tags have handled padding
is what creates these rendering issues. Just like an inline comment
suggested “word/outlook Emails ship a <style>….”. AFAIK This fix only
applies to the desktop classic version of outlook, and not OWA.
But besides that, there are infinite possibilities of emails being sent
with weird <style> tags that won’t play nice with this mechanism.
Modifying how tables and it’s contents are displayed is what creates edge
cases where email elements are not centered properly.
Basically my intuition here says that we should avoid modifying email CSS.
Ensuring an email renders correctly on mobile/etc is up to the sender to
ensure… not us. We just provide a blank canvas.
…On Fri, Jun 19, 2026 at 6:32 AM Linus Rath ***@***.***> wrote:
*rathlinus* left a comment (bulwarkmail/webmail#438)
<#438 (comment)>
maybe making this a setting but completely removing is not a option
—
Reply to this email directly, view it on GitHub
<#438?email_source=notifications&email_token=AOND4Y4BKMI7T7DT5FJTQJL5AUJCHA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTINZVGA3TEOJWHE42M4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2KYZTPN52GK4S7MNWGSY3L#issuecomment-4750729699>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AOND4Y3KMF27O2MH5I34F535AUJCHAVCNFSNUABGKJSXA33TNF2G64TZHMYTCOBQG44DAMRVGI5US43TOVSTWNBWHEZDQOJZGMZDLILWAI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
The logic of modifying email CSS based on unreliable heuristics can break HTML styling and rendering in unpredictable ways. Injecting Body Padding into the email itself, based on the presence of <style>, is unreliable, as many edge cases have not been accounted for, as seen in #433 with Outlook Web App. Beyond Outlook, there are certain marketing emails that may ship with a <style> tag but lack proper gutter/padding—in general, there are too many edge cases to make this method reliable.
This PR removes the CSS modifications (besides dark mode) and adds padding to the JSX wrapper itself. Email messages are rendered as is.
Changes
Related Issues
Closes #433
Type of Change
Checklist
npm run typecheck && npm run lintand there are no errorsnpm run build)locales/) if my changes affect user-facing textScreenshots / Demo
Notes for Reviewers
I'm not sure what the original intention behind handling the UI padding this way was, but in practice, it is rather unpredictable and an infinite game of chicken and egg. There are too many edge cases to reliably modify the CSS to ensure it renders correctly in our UI. In general, we should keep the email styling as close to the original as possible, and we just provide a canvas for it to be rendered in.