fix(CustomCatalog): adapt MetricsDiv text color for dark mode#1648
fix(CustomCatalog): adapt MetricsDiv text color for dark mode#1648sahillpaul wants to merge 3 commits into
Conversation
Removed hardcoded rgba color and replaced with theme.palette.text.default to ensure accessibility contrast when dark mode is toggled. Signed-off-by: sahillpaul <sahilpaul046@gmail.com>
There was a problem hiding this comment.
Code Review
This pull request updates the MetricsDiv styled component in style.tsx to use the theme's default text color instead of a hardcoded RGBA value. The reviewer noted that this color property is redundant because the child components explicitly define their own colors, and suggested removing the property entirely along with the unused theme parameter.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| export const MetricsDiv = styled('div')(({ theme }) => ({ | ||
| display: 'flex', | ||
| alignItems: 'center', | ||
| gap: '4px', | ||
| fontSize: '0.2rem', | ||
| color: 'rgba(26, 26, 26, .8)', | ||
| color: theme.palette.text.default, |
There was a problem hiding this comment.
The color property on MetricsDiv is redundant and has no effect on the rendered UI. This is because both of its children explicitly define their own colors:
Iconhas an explicitfillprop:fill={theme.palette.mode === 'light' ? DARK_TEAL : SNOW_WHITE}.MetricsCounthas an explicitcolorstyled property:color: theme.palette.mode === 'light' ? DARK_TEAL : SNOW_WHITE}.
To keep the codebase clean and avoid misleading future developers, we should remove the redundant color property and the unused theme parameter.
| export const MetricsDiv = styled('div')(({ theme }) => ({ | |
| display: 'flex', | |
| alignItems: 'center', | |
| gap: '4px', | |
| fontSize: '0.2rem', | |
| color: 'rgba(26, 26, 26, .8)', | |
| color: theme.palette.text.default, | |
| export const MetricsDiv = styled('div')(() => ({ | |
| display: 'flex', | |
| alignItems: 'center', | |
| gap: '4px', | |
| fontSize: '0.2rem', |
Signed-off-by: sahillpaul <sahilpaul046@gmail.com>
Removed hardcoded
rgba(26, 26, 26, .8)color and replaced it withtheme.palette.text.defaultto ensure accessibility contrast when dark mode is toggled.Notes for Reviewers
This resolves a critical WCAG accessibility contrast bug. Previously, the metrics text on the
CustomCatalogCardbecame completely unreadable against the dark teal background when the application was toggled into Dark Mode. TheMetricsDivcomponent now fully respects the Sistent theme contract.This PR fixes #1647
Signed commits