-
Notifications
You must be signed in to change notification settings - Fork 63
feat: Add dark mode to anywidget mode #2365
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
Conversation
- Updates table_widget.css to use CSS variables for colors where possible.
- Adds @media (prefers-color-scheme: dark) block to handle dark mode overrides.
- Updates text and background colors to be legible in dark mode.
- Adds unit test to verify CSS contains dark mode media query.
- Update TableWidget CSS with variables and media queries for dark mode. - Pass CSS content via a new 'css_styles' traitlet to ensure reliable loading. - Implement robust JavaScript logic to detect VS Code dark themes and recursively clear ancestor backgrounds, eliminating the 'white frame' issue. - Reformat CSS and JS files to comply with project style guides. - Add unit test for CSS traitlet population.
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.
I did not rewrite this file, I just reformat this file. In addition to the reformatting, a new set of tests for the dark mode "Theme detection" feature was also added. The newly added tests in table_widget.test.js are:
- should add bigframes-dark-mode class in dark mode
- should not add bigframes-dark-mode class in light mode
tswast
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.
Thanks!
The table now automatically adapts to dark and light themes in environments like Colab and VS Code for anywidget mode.
Verified at:
Fixes #<460861328> 🦕