Repository navigation
fix(markdown): keep links and other prose children in the callout color - #522
Conversation
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.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
There was a problem hiding this comment.
ℹ️ 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,kbdandli::markerusecolor: inherit, and links get acurrentColorunderline. These rules are unlayered, so they beat Typography's.prose :where(...)rules and theprose-code:*utilities fromTypography.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, becauseExpandableCoderenders<code>as a direct child of<pre>. - Code blocks no longer take the callout color —
.code-block-containerresets tovar(--tw-prose-body, …), so its plain text matches a code block outside a callout in bothprose-zincandprose-invert. - Tests and changeset — the regression test reads
styles.css?raw(8/8 pass locally). The changeset is a@docubook/markdownpatch.
Overall: READY WITH MINOR FIXES. Top priority: drop the table selectors or make them take effect (inline comment). Nothing else blocks.
claude-opus-5-5 | 𝕏
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.
There was a problem hiding this comment.
✅ 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.
TableMdxreads colors from CSS variables — the shell border, cell borders,thead/tfootfill andthcolor now come from--mdx-table-border,--mdx-table-head-bgand--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, socurrentColorresolves where it is used (the wrapperdiv,th,td,thead). Each of those inherits the inlinecolorset on.mdx-callout-content, so the tints follow every callout type and theme. - Dead selectors removed —
this out of thecolor: inheritlist, and the border rule now covers onlyhr. - Tests and changeset —
TableMdx.test.tsxchecks each variable and its fallback. TheCallout.test.tsxregex matches only the bare.mdx-callout-content {rule. 13/13 tests pass locally. The changeset now describes the table change accurately.
Overall: READY.
claude-opus-5-5 | 𝕏

Summary
Follow-up to #520. Bold was not the only callout child that
.proserepainted. Links, headings, inline code, blockquotes, table headers, definition terms,kbdand 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
infocallout 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.codeh1–h6dt,kbdTableMdx): border, header text, header fill--mutedfill (inline styles)--mdx-table-*variableshrborderstrong,em,del,sup,td,litextmarkThere is also one leak in the other direction. A code block is
not-prose, so its plain text inherited the callout color. It now usesvar(--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-colorand--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-contentblock, merged with the bold rule from fix(markdown): keep bold text in the callout color #520. It sets the table variables fromcurrentColor. Inline code is scoped to:not(pre) > code, so code blocks are never tinted. Tints usecolor-mix(in srgb, currentColor N%, transparent), so they follow every callout type and theme.Callout.test.tsxasserts each rule and the table variables, and fails when the link selector is removed.TableMdx.test.tsxchecks the variables and their fallbacks.@docubook/markdown.The table rows were measured on real
TableMdxtables ininfoandwarningcallouts, using a temporary docs page that was removed afterwards. A table outside a callout keeps its gray border, muted header and--mutedfill in both modes. Inside a callout, all three follow the callout color.@docubook/markdowntests (150) pass, and typecheck, oxlint and prettier are clean.