[fix] Render markdown headings by level instead of uppercasing#4548
Conversation
The beautified/markdown view forced H2 headings to uppercase via text-transform, rewriting the user's own prompt text. H1 was also lighter than H2, and H3-H6 had no styling. Apply a consistent best-practice scale (descending sizes, shared weight/color/spacing) across H1-H6 in both light and dark mode, with no case transform.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughThis PR consolidates repetitive CSS rules for editor headings across light and dark theme contexts. Light-theme heading styles are grouped into a unified selector with common properties while preserving per-heading font sizes. Dark-theme heading overrides are similarly consolidated for ChangesEditor Heading Styles Consolidation
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
Railway Preview Environment
Updated at 2026-06-05T10:43:08.329Z |
Context
In the playground and the beautified markdown view, every
## Headingyou typed rendered in all caps. The Lexical editor theme appliedtext-transform: uppercaseto H2, so it rewrote your own prompt text. H1 also rendered lighter than H2, and H3 to H6 had no styling and fell back to browser defaults, so the heading hierarchy looked inconsistent.Changes
Replaced the H1/H2-only rules in
web/oss/src/styles/editor-theme.csswith one shared rule for H1 to H6 (same color, weight 600, spacing, line-height) plus a descending size scale. Removed the uppercase transform. Extended the dark-mode override to cover all six levels so the new explicit colors do not render dark-on-dark.Before:
## Some Headingshowed asSOME HEADING.After: it shows as
Some Heading, sized by its level.Size scale: H1 24px, H2 20px, H3 17px, H4 15px, H5 14px, H6 13px (muted).
