Skip to content

Converted em line-height values to unitless in email templates#26825

Open
minimaluminium wants to merge 3 commits intomainfrom
email-large-text-DES-1306
Open

Converted em line-height values to unitless in email templates#26825
minimaluminium wants to merge 3 commits intomainfrom
email-large-text-DES-1306

Conversation

@minimaluminium
Copy link
Copy Markdown
Member

ref https://linear.app/ghost/issue/DES-1306/text-size-issues-when-using-accessibility-features-on-iphones

When iPhone users increase text size via iOS Dynamic Type, Ghost newsletter emails have excessively large line spacing, making them nearly unreadable. The root cause is em-based line-height values in the email template — when Dynamic Type scales font sizes, em line-heights compound the scaling.

This converts all line-height: Xem values to unitless line-height: X in the email stylesheet. Unitless values are the recommended best practice for email accessibility, as they scale proportionally without compounding.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 16, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 2071e740-831c-4428-8cb8-f8c46f3e9970

📥 Commits

Reviewing files that changed from the base of the PR and between 780c9f8 and 28e9852.

📒 Files selected for processing (1)
  • ghost/core/core/server/services/email-service/email-templates/partials/styles.hbs

Walkthrough

The patch modifies email template CSS to standardize line-height declarations. Line-height values with unit suffixes (em, px) are converted to unitless numbers. Most em-based values like 1.6em and 1.2em are replaced with their numeric equivalents (1.6, 1.2). Pixel-based values are converted to precise unitless ratios (e.g., 18px becomes 1.125). These changes apply across multiple CSS selectors including headings, paragraphs, blockquotes, and component-specific styles. The modification affects 47 lines in the styles.hbs file.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: converting em-based line-height values to unitless equivalents in email templates.
Description check ✅ Passed The description is directly related to the changeset, explaining the accessibility issue, root cause, solution, and rationale for converting em-based line-heights to unitless values.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch email-large-text-DES-1306
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ErisDS
Copy link
Copy Markdown
Member

ErisDS commented Mar 16, 2026

🤖 Velo CI Failure Analysis

Classification: 🟠 SOFT FAIL

  • Workflow: CI
  • Failed Step: E2E tests
  • Run: View failed run
    What failed: Code coverage below required threshold
    Why: The failure is caused by a code issue that needs to be fixed in this PR.
    Action:
    Check the error message and fix the issue in your code.

Prevents compounding line-height scaling when iOS Dynamic Type
increases font sizes, which caused excessive line spacing in
newsletter emails.
@minimaluminium minimaluminium force-pushed the email-large-text-DES-1306 branch from 28e9852 to a4e4598 Compare April 10, 2026 10:54
@sonarqubecloud
Copy link
Copy Markdown

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.

2 participants