Skip to content

Fix TipTap editor: formatting toolbar buttons don't visibly render - #29

Merged
kiran-brahma merged 1 commit into
mainfrom
fix/tiptap-editor-formatting-styles
Jul 8, 2026
Merged

Fix TipTap editor: formatting toolbar buttons don't visibly render#29
kiran-brahma merged 1 commit into
mainfrom
fix/tiptap-editor-formatting-styles

Conversation

@kiran-brahma

Copy link
Copy Markdown
Owner

Summary

On the Home Page hero (and every other content_html/description field — blog, podcast, landing page — since they all share the one RichEditorTiptap component via FormRenderer's richtext widget), only Bold and Italic visibly did anything in the editor. Every other toolbar button (H1-H6, lists, blockquote, code block, horizontal rule, highlight, task list) correctly toggled the underlying HTML tag, but nothing changed on screen.

Root cause: Tailwind's preflight reset strips default browser styling from h1-h6, ul/ol, blockquote, pre/code, hr, etc. Bold/Italic worked by accident — <strong>/<em> render bold/italic natively with zero CSS. Nothing compensated for the reset inside the editor's contenteditable area (.lh-rich-editor-content), so those tags rendered as plain text.

Fix

Added typography rules scoped to .lh-rich-editor-content .ProseMirror in client-src/common/admin_styles.css — headings, lists (incl. task list checkboxes), blockquote, code block, hr, highlight/mark, links, images, underline/strike. One shared component, one CSS fix, covers every content type's rich text field.

Test plan

  • yarn test — 69/69 suites, 412/412 tests pass locally
  • Could not spin up a full local dev server in this environment (no .vars.toml/Cloudflare secrets in this worktree) to visually confirm in-browser — please verify the editor toolbar (headings/lists/blockquote/etc.) renders visibly after deploying via your GitHub Actions pipeline.

Tailwind's preflight reset strips default browser styling from h1-h6,
ul/ol, blockquote, pre/code, hr, etc. Bold/Italic were the only toolbar
buttons that visibly worked because <strong>/<em> render bold/italic
natively with no CSS. Every other button (headings, lists, blockquote,
code block, horizontal rule, highlight, task list) correctly changed the
underlying HTML tag, but it rendered identically to plain text in the
editor, so it looked broken.

Added typography rules scoped to .lh-rich-editor-content .ProseMirror.
This is the single shared TipTap instance (RichEditorTiptap, wired
through FormRenderer's richtext widget) used for every content_html /
description field across content types (blog_article, podcast_episode,
landing_page, and the home_page hero), so one fix covers all of them.
@kiran-brahma
kiran-brahma merged commit 1bad57e into main Jul 8, 2026
1 check passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c2d2e11b6e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

}

.lh-rich-editor-content .ProseMirror {
outline: none;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep a visible focus indicator on the editor

When users tab into the TipTap contenteditable, this rule removes the browser outline and the wrapper/editor CSS doesn't add any :focus/:focus-visible ring, leaving no visible indication that the editor has focus. This is an accessibility regression for keyboard users; either retain the outline or replace it with a scoped focus style.

Useful? React with 👍 / 👎.

@kiran-brahma
kiran-brahma deleted the fix/tiptap-editor-formatting-styles branch July 8, 2026 05:36
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.

1 participant