Fix MarkdownBlock text color for Dark High Contrast theme #1583
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.

Context
When using the "Dark High Contrast" Theme in VS Code, file references like filename in Roo Code's chat responses were not visible because they appeared as black text on a black background, creating a contrast issue that made the text unreadable.
Implementation
I fixed this issue by adding a theme-specific CSS rule that only applies when the Dark High Contrast theme is active. The implementation:
Identified the issue in the MarkdownBlock.tsx component where inline code blocks (code:not(pre > code)) were styled
Added a specific CSS rule that targets only the Dark High Contrast theme using VS Code's theme data attribute
Used VS Code theme tokens for the text color to ensure proper theming and contrast
Implemented a fallback chain of theme tokens to ensure compatibility
The key part of the implementation is this CSS rule:
This approach ensures that:
Only the Dark High Contrast theme is affected, preserving the styling in other themes
The color is derived from VS Code's theme tokens rather than hardcoded.
Multiple fallbacks are provided to ensure compatibility across different VS Code versions
Screenshots
How to Test
Open VS Code and switch to the "Dark High Contrast" theme (File > Preferences > Color Theme > Dark High Contrast)
Open Roo Code and start a conversation
Look for file references in Roo's responses (text wrapped in backticks like filename)
Verify that these file references are now clearly visible with proper contrast
Switch to other themes and verify that file references appear with their normal styling
Important
Fixes text visibility issue in Dark High Contrast theme by adding a CSS rule to
MarkdownBlock.tsxfor inline code blocks.MarkdownBlock.tsx.code:not(pre > code)elements to change text color using VS Code theme tokens.StyledMarkdowninMarkdownBlock.tsxto apply only when Dark High Contrast theme is active.--vscode-editorInlayHint-foregroundand other theme tokens for color.This description was created by
for 49fca10. It will automatically update as commits are pushed.