fix: add white background to improve image visibility in dark mode #484
fix: add white background to improve image visibility in dark mode #484senutpal wants to merge 1 commit intoCircuitVerse:masterfrom
Conversation
WalkthroughThis change adds a CSS rule to the dark theme stylesheet that sets Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
src/css/darkTheme.css (2)
6-8: Consider adding selective targeting for images that need backgrounds.The current rule applies a white background to ALL documentation images. While this fixes the visibility issue, it may also affect images that are designed for dark backgrounds (e.g., screenshots of dark-themed UIs). Consider one of these approaches:
- Add a CSS class like
.light-bg-imgthat can be selectively applied to images needing white backgrounds- Provide an opt-out mechanism with a class like
.no-bgfor images designed for dark mode🔎 Example: Selective targeting approach
/* Fix image visibility in dark mode */ -[data-theme='dark'] .theme-doc-markdown img { +[data-theme='dark'] .theme-doc-markdown img:not(.no-bg) { background-color: #ffffff; }This allows specific images to opt out by adding the
no-bgclass when needed.
6-8: Optional: Consider adding padding and border-radius for visual polish.Issue #416 mentioned optional padding and border-radius to improve the visual presentation of images with white backgrounds. These additions could soften the appearance and provide better separation from the page background.
🔎 Example: Adding visual polish
/* Fix image visibility in dark mode */ [data-theme='dark'] .theme-doc-markdown img { background-color: #ffffff; + padding: 8px; + border-radius: 4px; }
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/css/darkTheme.css
🔇 Additional comments (1)
src/css/darkTheme.css (1)
5-8: LGTM! Core fix addresses the visibility issue effectively.The CSS-only approach is more maintainable than replacing images individually. The selector correctly targets documentation images in dark mode, and the white background ensures dark image elements remain visible.
Fixes a visibility issue where transparent images with black elements blend into the dark background. This is a CSS-only fix that applies globally to all documentation pages. Fixes CircuitVerse#416
902f881 to
1376ccc
Compare
|
@Nihal4777 Please Review This :) |
Closes #416
Changes done:
darkTheme.cssto apply white background to images in dark modeContext:
PR #454 attempted to resolve this issue by replacing images with hardcoded white backgrounds. However, a CSS-based approach was requested as it's more maintainable and doesn't require modifying individual image files. Since there has been no response for over 3 weeks on that request, I've implemented the CSS fix directly.
CSS Solution:
Screenshots:
Before (Dark Mode):

After (Dark Mode):

✅️ By submitting this PR, I have verified the following
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.