Skip to content

fix(markdown): keep links and other prose children in the callout color - #522

Merged
gitfromwildan merged 2 commits into
mainfrom
fix/markdown-callout-prose-children
Nov 10, 2026
Merged

gitfromwildan merged 2 commits into
mainfrom
fix/markdown-callout-prose-children

Conversation

@gitfromwildan

@gitfromwildan gitfromwildan commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

Summary

Follow-up to #520. Bold was not the only callout child that .prose repainted. Links, headings, inline code, blockquotes, table headers, definition terms, kbd and list markers also took the typography ink color (near black in light mode, white in dark mode), so a URL in a callout showed as a black or white link on the tinted panel.

Audit

Every markdown element was injected into an info callout on the built docs (/docs/getting-started/search/algolia), and its computed color was compared with the callout body color in light and dark mode.

Element Before After
Links (internal, external, wrapping code or bold) ink / white, ink underline callout color, underline in that color
Inline code stone-800 / white on gray callout color, fill and border tinted from it
h1–h6 ink / white callout color
Blockquote ink text and left rule callout color, rule tinted from it
dt, kbd ink / white callout color (kbd shadow tinted)
List markers gray / ink callout color
Markdown tables (TableMdx): border, header text, header fill neutral gray border, muted-foreground header, --muted fill (inline styles) tints of the callout color through --mdx-table-* variables
hr border neutral gray tint of the callout color
strong, em, del, sup, td, li text already followed (bold since #520) unchanged
mark UA yellow highlight, not from prose unchanged on purpose

There is also one leak in the other direction. A code block is not-prose, so its plain text inherited the callout color. It now uses var(--tw-prose-body), with the theme foreground as the fallback, so its plain text matches a code block outside a callout in both modes. Highlighter token colors are unchanged.

Change

  • TableMdx.tsx: border, header color and header fill read --mdx-table-border, --mdx-table-head-color and --mdx-table-head-bg, falling back to the theme values used before, so tables outside a callout are unchanged. Inline styles beat the stylesheet, so this is how a callout reaches its tables.
  • styles.css: one .mdx-callout-content block, merged with the bold rule from fix(markdown): keep bold text in the callout color #520. It sets the table variables from currentColor. Inline code is scoped to :not(pre) > code, so code blocks are never tinted. Tints use color-mix(in srgb, currentColor N%, transparent), so they follow every callout type and theme.
  • Callout.test.tsx asserts each rule and the table variables, and fails when the link selector is removed. TableMdx.test.tsx checks the variables and their fallbacks.
  • A patch changeset for @docubook/markdown.

The table rows were measured on real TableMdx tables in info and warning callouts, using a temporary docs page that was removed afterwards. A table outside a callout keeps its gray border, muted header and --muted fill in both modes. Inside a callout, all three follow the callout color.

@docubook/markdown tests (150) pass, and typecheck, oxlint and prettier are clean.

Bold was not the only callout child that `.prose` repainted. Links,
headings, inline code, blockquotes, table headers, definition terms,
kbd and list markers also took the typography ink color (near black,
white in dark mode), so a URL in a callout showed as a black or white
link on the tinted panel.

They now inherit the callout color. Links keep their underline in that
color, and the borders of inline code, kbd, blockquotes, tables and
rules, plus the fill of inline code, are tints of it. Code inside <pre>
is left to the highlighter, and a code block in a callout takes the
page's body color for its plain text, because it is not-prose and would
otherwise inherit the callout color.
@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 Preview Nov 10, 2026 11:18am 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 critical issues. One rough edge inline: the table rules don't reach real markdown tables.

Reviewed changes

Reviewed the whole PR (mode: standard). It extends the #520 callout color fix to every prose child that .prose repaints.

  • Callout prose children inherit the callout color — a, headings, blockquote, dt, kbd and li::marker use color: inherit, and links get a currentColor underline. These rules are unlayered, so they beat Typography's .prose :where(...) rules and the prose-code:* utilities from Typography.tsx, which sit in @layer utilities.
  • Inline code tinted from currentColor — the rule is scoped to :not(pre) > code. Block code stays out of it, because ExpandableCode renders <code> as a direct child of <pre>.
  • Code blocks no longer take the callout color — .code-block-container resets to var(--tw-prose-body, …), so its plain text matches a code block outside a callout in both prose-zinc and prose-invert.
  • Tests and changeset — the regression test reads styles.css?raw (8/8 pass locally). The changeset is a @docubook/markdown patch.

Overall: READY WITH MINOR FIXES. Top priority: drop the table selectors or make them take effect (inline comment). Nothing else blocks.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using claude-opus-5-5 | 𝕏

Comment thread packages/markdown/styles.css Resolved
Markdown tables render through TableMdx, whose inline color on th and
inline borders on every cell beat the stylesheet, so the callout's table
selectors never reached a real table. TableMdx now reads its border,
header color and header fill from --mdx-table-border,
--mdx-table-head-color and --mdx-table-head-bg, falling back to the
theme values it used before, and the callout body sets them from its
own color. The table selectors that had no effect are dropped, leaving
hr as the only element with a tinted border rule.

@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. The earlier table finding is fixed: tables inside a callout now pick up its color.

Reviewed changes

Reviewed 314590f (mode: standard), the one commit since the last Pullfrog review. It makes the callout's table tinting take effect, where before the selectors had no effect.

  • TableMdx reads colors from CSS variables — the shell border, cell borders, thead/tfoot fill and th color now come from --mdx-table-border, --mdx-table-head-bg and --mdx-table-head-color. Each falls back to the exact theme value used before, so tables outside a callout render the same.
  • The callout sets the variables from currentColor — the variables aren't registered, so currentColor resolves where it is used (the wrapper div, th, td, thead). Each of those inherits the inline color set on .mdx-callout-content, so the tints follow every callout type and theme.
  • Dead selectors removed — th is out of the color: inherit list, and the border rule now covers only hr.
  • Tests and changeset — TableMdx.test.tsx checks each variable and its fallback. The Callout.test.tsx regex matches only the bare .mdx-callout-content { rule. 13/13 tests pass locally. The changeset now describes the table change accurately.

Overall: READY.

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

@gitfromwildan
gitfromwildan merged commit ebde9ab into main Nov 10, 2026
15 checks passed
@gitfromwildan
gitfromwildan deleted the fix/markdown-callout-prose-children branch November 10, 2026 11:30
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