fix: improve inline code contrast inside greybox - closes #2677#2678
Draft
github-actions[bot] wants to merge 1 commit into
Draft
fix: improve inline code contrast inside greybox - closes #2677#2678github-actions[bot] wants to merge 1 commit into
github-actions[bot] wants to merge 1 commit into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Inline code elements inside greybox containers were visually indistinguishable because both used the same
bg-gray-100background colour. This made inlinecodesnippets blend into the surrounding gray box.Root Cause
In
typography-components.tsx, thecodecomponent is styled withbg-gray-100 py-1 px-2 rounded-sm. The greybox variant inboxEmbed.tsxusescontainerClass: "bg-gray-100"— identical backgrounds, no visual contrast.Fix
Added a
greyboxMarkdownComponentsconstant inboxEmbed.tsxthat spreads the defaultMarkdownComponentMappingbut overrides thecodecomponent to usebg-whiteinstead ofbg-gray-100. TheTinaMarkdowninsideBoxEmbednow uses this custom mapping when the variant is"greybox", and the standard mapping for all other box variants.What's unchanged
bg-gray-100(unchanged)info,warning,tips, etc.) use the standard mapping (they already have white/distinct backgrounds)Closes #2677