Skip to content

fix(markdown): keep bold text in the callout color - #520

Merged
gitfromwildan merged 1 commit into
mainfrom
fix/markdown-callout-bold-color
Nov 10, 2026
Merged

gitfromwildan merged 1 commit into
mainfrom
fix/markdown-callout-bold-color

Conversation

@gitfromwildan

Copy link
Copy Markdown
Member

Summary

Inside a callout, **bold** ignored the callout type's color token. Docs content sits in Tailwind Typography's .prose, which gives strong its own color (--tw-prose-bold: near black in light mode, white in dark mode). That color replaced the callout color the bold text should inherit, so it showed as an ink-colored word on a tinted panel.

Fix

  • Callout.tsx: the callout body gets the mdx-callout-content class next to its existing inline color: token.content.
  • styles.css: .mdx-callout-content :is(strong, b) sets color: inherit and font-weight: 700. Bold keeps the callout color and stands out by weight instead, one step above prose's 600. The selector outranks .prose :where(strong), and the rule covers every callout type, GFM alerts included.
  • A test checks the class and the rule. A patch changeset is included for @docubook/markdown.

Verification

Measured in Chromium on the info callout of /docs/getting-started/search/algolia (built docs, computed styles):

Bold color Bold weight Body color
Before, light oklch(0.22 0.03 260) 600 rgba(52, 143, 234, 0.75)
Before, dark rgb(255, 255, 255) 600 rgba(87, 171, 255, 0.75)
After, light rgba(52, 143, 234, 0.75) 700 rgba(52, 143, 234, 0.75)
After, dark rgba(87, 171, 255, 0.75) 700 rgba(87, 171, 255, 0.75)

The @docubook/markdown tests (148) pass, and typecheck and prettier are clean.

Inside a callout, **bold** took the typography styles' ink color (near
black, white in dark mode) instead of the color token of the callout
type, because `.prose strong` sets its own color over the inherited one.
The callout body now carries the mdx-callout-content class, and bold in
it inherits the callout color and stands out by weight instead, raised
from prose's 600 to 700.
@vercel

vercel Bot commented Nov 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docu Ignored Ignored Nov 10, 2026 10:24am UTC

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ No new issues found.

Reviewed changes

Mode: standard. This run covered the whole PR: a scoped CSS override that stops .prose from repainting bold text inside callouts. Verdict: READY.

  • Callout content hook: Callout.tsx gives the content <div> an mdx-callout-content class and keeps the inline color: token.content. Every callout type and GFM alert uses this element, because registry/index.ts builds them all through callout(type) → Callout.
  • Bold override: styles.css adds .mdx-callout-content :is(strong, b) { color: inherit; font-weight: 700 }. Typography's selector is .prose :where(strong):not(:where(...)) with specificity (0,1,0). The new rule has (0,1,1) and sits outside any layer, so it wins as the PR describes.
  • Regression test + changeset: The test checks the class and the rule text through styles.css?raw, the same way CodeBlockBleed/MermaidMdx tests do. A @docubook/markdown patch changeset is included.

I ran npx vitest run src/__test__/Callout.test.tsx (7 passed) and tsc -p tsconfig.json --noEmit (clean) locally.

Pullfrog  | View workflow run | Using claude-opus-5-5 | 𝕏

@gitfromwildan gitfromwildan self-assigned this Nov 10, 2026
@gitfromwildan
gitfromwildan merged commit 87aed07 into main Nov 10, 2026
15 checks passed
@gitfromwildan
gitfromwildan deleted the fix/markdown-callout-bold-color branch November 10, 2026 10:26
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