Skip to content

fix(code): stop scaling markdown italics 1.18×#1887

Draft
posthog[bot] wants to merge 1 commit intomainfrom
posthog-code/fix-oversized-italics
Draft

fix(code): stop scaling markdown italics 1.18×#1887
posthog[bot] wants to merge 1 commit intomainfrom
posthog-code/fix-oversized-italics

Conversation

@posthog
Copy link
Copy Markdown
Contributor

@posthog posthog Bot commented Apr 25, 2026

Summary

Italics in agent chat (and any other MarkdownRenderer surface) were rendering noticeably larger than the surrounding text. Root cause: Radix Themes ships these defaults

--em-font-size-adjust: 1.18;
--quote-font-size-adjust: 1.18;

…and the Em/Quote components apply them via font-size: calc(var(--em-font-size-adjust) * 1em). The 1.18 multiplier exists to make Times New Roman italic (smaller x-height) visually match a neighbouring sans-serif. Since globals.css already overrides --em-font-family and --quote-font-family to var(--font-sans) (Open Runde), the compensation no longer applies — it just inflates italics by ~18%.

Setting both adjustments to 1 brings italics back in line with body text.

Test plan

  • In agent chat, send a message containing *italic text* and _more italic_; verify italics now match the body text size.
  • Block quotes (> quoted line) render at body size.
  • No regression to bold (**strong**), inline code, or code blocks.

Created with PostHog Code

Radix Themes ships --em-font-size-adjust: 1.18 (and the same for Quote)
to make Times New Roman italic visually match the surrounding sans body.
Since we override --em-font-family / --quote-font-family to Open Runde,
the compensation no longer applies and just makes italics render ~18%
larger than neighbouring text — the "hilariously large" italics seen in
agent chat. Set both adjustments to 1.

Generated-By: PostHog Code
Task-Id: ad6f03b1-a226-42a3-99df-47cb2ed0a51f
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.

0 participants