Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix over-scaling mail body on mobile #8461

Merged
merged 2 commits into from
Feb 5, 2025
Merged

Conversation

hrb-hub
Copy link
Contributor

@hrb-hub hrb-hub commented Feb 4, 2025

  • Break preformatted text on mobile.
  • Wrap unbreakable long lines of text when scaling exceeds a certain threshold (scaling might still be applied on top, if necessary).

Before

After

@hrb-hub hrb-hub linked an issue Feb 4, 2025 that may be closed by this pull request
5 tasks
@hrb-hub hrb-hub force-pushed the 8460-mail-body-scaling branch from fbd7ea9 to 0fe01cf Compare February 4, 2025 09:35
Copy link
Contributor

@charlag charlag left a comment

Choose a reason for hiding this comment

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

Looks really good!
We could expand on the first commit message a bit

@hrb-hub hrb-hub force-pushed the 8460-mail-body-scaling branch from 0fe01cf to 49cb8d5 Compare February 5, 2025 11:01
Preformatted text in mail body is supposed to be wrapped on mobile but
isn't due to an incorrect CSS selector.
@hrb-hub hrb-hub force-pushed the 8460-mail-body-scaling branch from 49cb8d5 to 83fddf6 Compare February 5, 2025 11:08
When scaling exceeds a threshold of 0.65, unbreakable long text is
wrapped by setting the mail body's "overflowWrap" to "anywhere".
Scaling might also be applied on top, if necessary.

0.65 was chosen as a threshold since a 0.65 scaling applied to a 16px
font size would result in a 10.4px font size.

Close #8460
@hrb-hub hrb-hub force-pushed the 8460-mail-body-scaling branch from 83fddf6 to d77e32e Compare February 5, 2025 12:14
@hrb-hub hrb-hub merged commit d77e32e into dev-mail Feb 5, 2025
6 checks passed
@hrb-hub hrb-hub deleted the 8460-mail-body-scaling branch February 5, 2025 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Over-scaled and unreadable mail body on mobile
2 participants