Skip to content

Fix document headers rendering as normal text - #1471

Open
drusepth wants to merge 1 commit into
tailwind-redesignfrom
claude/document-headers-bug-al9msk
Open

Fix document headers rendering as normal text#1471
drusepth wants to merge 1 commit into
tailwind-redesignfrom
claude/document-headers-bug-al9msk

Conversation

@drusepth

Copy link
Copy Markdown
Member

Fixes #

Changes proposed:

  • Install @tailwindcss/typography (v0.5.20) and register it in tailwind.config.js, so the prose, prose-lg, prose-headings:*, and dark:prose-invert classes already used across ~32 views actually generate CSS
  • This fixes the reported bug where applying any of the editor's three header options left the text looking completely unchanged: the <h2>/<h3>/<h4> tags were applied correctly, but with the plugin missing, Tailwind's preflight reset collapsed every heading to paragraph size/weight on the document reading view (verified: an <h2> computed to 16px / weight 400, identical to a <p>; after this change it renders 36px / bold)
  • CSS bundle impact is negligible: +35 KB minified / +3.9 KB gzipped, no JS or runtime changes

Known follow-ups surfaced during review (not included in this PR):

  • app/javascript/application.css imports Tailwind layers as base → utilities → components; the plugin's .prose component rules therefore land after utilities and override max-w-none / text-gray-900 on prose containers. Should be reordered to base → components → utilities.
  • Legacy hand-rolled .prose margin rules in timeline_viewer.scss and document_editor.scss (specificity 0,1,1) still override the plugin's :where()-based spacing site-wide, e.g. .prose h1-h6 { margin-top: 0 }.
  • The editor still styles headings via legacy #editor h2/h3/h4 rules in editor.scss, so editor and reading view render headings slightly differently.

@indentlabs/contributors

🤖 Generated with Claude Code

https://claude.ai/code/session_01E4YsrszSBT4ReLYDx3arEu


Generated by Claude Code

The document editor and reading views style content with Tailwind
Typography classes (prose, prose-lg, prose-headings:*, dark:prose-invert),
but the @tailwindcss/typography plugin was never installed, so none of
those classes generated any CSS. Tailwind's preflight reset then collapsed
h2/h3/h4 to paragraph size and weight, so applying any of the editor's
three header options produced text that looked completely unchanged on
the document reading view.

Install @tailwindcss/typography and register it in tailwind.config.js so
the prose classes already present across the app's views take effect.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E4YsrszSBT4ReLYDx3arEu
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