Skip to content

fix: improve inline code contrast inside greybox - closes #2677#2678

Draft
github-actions[bot] wants to merge 1 commit into
mainfrom
fix/inline-code-greybox-contrast-2677-f7a5298c1ee2bed6
Draft

fix: improve inline code contrast inside greybox - closes #2677#2678
github-actions[bot] wants to merge 1 commit into
mainfrom
fix/inline-code-greybox-contrast-2677-f7a5298c1ee2bed6

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Problem

Inline code elements inside greybox containers were visually indistinguishable because both used the same bg-gray-100 background colour. This made inline code snippets blend into the surrounding gray box.

Root Cause

In typography-components.tsx, the code component is styled with bg-gray-100 py-1 px-2 rounded-sm. The greybox variant in boxEmbed.tsx uses containerClass: "bg-gray-100" — identical backgrounds, no visual contrast.

Fix

Added a greyboxMarkdownComponents constant in boxEmbed.tsx that spreads the default MarkdownComponentMapping but overrides the code component to use bg-white instead of bg-gray-100. The TinaMarkdown inside BoxEmbed now uses this custom mapping when the variant is "greybox", and the standard mapping for all other box variants.

const greyboxMarkdownComponents = {
  ...MarkdownComponentMapping,
  code: (props: any) => <code className="bg-white py-1 px-2 rounded-sm" {...props} />,
};
// ...
<TinaMarkdown content={data.body} components={variant === "greybox" ? greyboxMarkdownComponents : MarkdownComponentMapping} />

What's unchanged

  • Inline code styling outside gray boxes remains bg-gray-100 (unchanged)
  • All other box variants (info, warning, tips, etc.) use the standard mapping (they already have white/distinct backgrounds)
  • No other components modified

Closes #2677

Generated by Issue Triage for issue #2677 · ● 823.5K ·

Inline code elements use bg-gray-100 which blends with the greybox
container that also uses bg-gray-100. Override the code component
mapping for greybox to use bg-white instead, ensuring inline code
is visually distinguishable inside gray content boxes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

🎨 UI - Inline code styling blends into gray code block backgrounds

0 participants