-
Notifications
You must be signed in to change notification settings - Fork 405
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
base: master
Are you sure you want to change the base?
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.
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-scheme
media queryImplementation Details
webform-template.html
webform.js
webform-sample.css
Testing
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.