-
Notifications
You must be signed in to change notification settings - Fork 414
Add comprehensive dark mode implementation for grpcui #398
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add comprehensive dark mode implementation for grpcui #398
Conversation
- Add dark mode toggle switch in webform template with accessibility features
- Implement localStorage persistence and system preference detection
- Apply professional GitHub-inspired dark color scheme
- Add comprehensive dark mode CSS for all UI elements including:
- Form inputs, buttons, and controls
- Tables, tabs, and response panels
- Error messages and status indicators
- jQuery UI datepicker/calendar widget
- Ensure proper contrast ratios for accessibility
- Maintain cross-browser compatibility
|
@gpassini @dragonsinth @jhump @n0v1 Hi! I know u guys might be busy, but I would much appreciate a review as per your earliest convivence! Cheers 🥂! |
|
@jainal09 honestly this is a bit much... I think we could accept a pure-CSS change using |
|
@dragonsinth , Thank you for the feedback! I understand the concern about complexity, but The Problem:
So, I propose we find a middle ground approach:
The localStorage is really the minimum viable functionality needed. Modern Would this simplified approach with minimal persistence be acceptable? |
|
I made some changes and this is how it will look like if you approve it This looks minimal and not too overkill You can check the latest push for the new code changes. If you still dont like it I am open to make it to just system theme preference dependent. But I feel like this should address your concerns. @dragonsinth |
- Replace complex toggle switch with intuitive sun/moon icon button - Implement minimal localStorage persistence for user preference - Add system preference detection as fallback using prefers-color-scheme - Apply GitHub-inspired dark color scheme with proper contrast ratios - Position theme toggle on viewport edge to prevent layout issues - Reduce JavaScript complexity from ~75 to ~25 lines of code - Maintain cross-browser compatibility and accessibility standards Addresses maintainer feedback about implementation complexity while preserving essential UX functionality for voluntary theme switching.
|
@dragonsinth just checking in. If you have any updates for me. LMK what is your thoughts on my recent changes: middle ground approach |
|
I'm a fan of the pure-CSS, system-settings approach. |
Replace JavaScript-based theme toggle with automatic dark mode detection using CSS media queries. The UI now respects system preferences without requiring user interaction or JavaScript. - Remove theme toggle button and related UI elements - Convert class-based dark mode (.grpc-theme-dark) to @media (prefers-color-scheme: dark) - Remove initTheme() function and all theme switching JavaScript - Remove localStorage theme persistence - Improve type label visibility in dark mode (color: #c9d1d9) - Add dark mode support for all UI elements including jQuery UI datepicker - Simplify CSS selectors by removing theme-related classes BREAKING CHANGE: Theme toggle button removed. Dark mode now follows system settings only.
|
@dragonsinth done. Removed all custom js and UI button and implemented a pure CSS based darkmode that detects from system settings and applies the dark mode theme! |
dragonsinth
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Implements light vs. dark mode using CSS device query.


Summary
Implements a complete dark mode feature for grpcui with a toggle switch that allows users to seamlessly switch between light and dark themes.
All this time whenever I was working with your amazing tool, my eyes would pop out whenever I would switch tabs from dark theme of my editor to my browser to test my GRPC server. So, I thought I need dark mode ASAP!
Hope this helps others like me!
Features
prefers-color-schememedia queryImplementation Details
webform-template.htmlwebform.jswebform-sample.cssTesting
Tested comprehensively with the KitchenSink test server to ensure all UI elements (including calendar widgets with timestamp fields) render correctly in both light and dark modes.
Screenshots
The implementation provides a professional dark theme that matches modern UI expectations while maintaining full functionality and accessibility.