fix(dashboard): make dark the CSS default for the TUI - #430
Merged
Conversation
Paint the GitHub-dark canvas from :root so first load is dark even without a class. Treat only an explicit localStorage theme of "light" as light; leftover next-themes "system" values stay dark. Co-Authored-By: Duyet Le <me@duyet.net> Co-Authored-By: duyetbot <bot@duyet.net>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 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 |
Reviewer's GuideMake dark theme the true CSS default for the dashboard TUI, with light explicitly opt-in via html.light and only localStorage.theme === 'light', align next-themes and the inline script to that contract, and add a test plus docs note to lock in the behavior. Flow diagram for dashboard theme default and toggle behaviorflowchart LR
start([Initial page load])
check_ls{{localStorage.theme === 'light'}}
dark_default([Apply dark default
- html: .dark
- remove .light
- data-mode/theme: 'dark'
- :root + .dark tokens])
light_opt_in([Apply light opt-in
- html: .light
- remove .dark
- data-mode/theme: 'light'
- .light tokens])
start --> check_ls
check_ls -- yes --> light_opt_in
check_ls -- no --> dark_default
click([User clicks element
with data-theme-toggle])
check_class{{html.classList.contains 'dark'}}
set_light([Switch to light
- add .light
- remove .dark
- data-mode/theme: 'light'
- localStorage.theme = 'light'])
set_dark([Switch to dark
- add .dark
- remove .light
- data-mode/theme: 'dark'
- localStorage.theme = 'dark'])
click --> check_class
check_class -- yes (currently dark) --> set_light
check_class -- no (currently light) --> set_dark
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Dark is now the real default for the terminal TUI, not just a class that can lose to a leftover
theme=systemor a light:rootpalette.Why
:rootwas still the light GitHub palette, so any missing.darkclass (or a stored next-themes"system"value) painted the site light. First load should be the#0d1117canvas.What changed
:root(and.dark); light is opt-in viahtml.lightlocalStorage.theme === "light"as light. Empty,"dark", and legacy"system"all stay darklight→ classlightso the dashboard toggle still worksLight remains available from
[theme].Summary by Sourcery
Make the terminal dashboard dark by default and require an explicit light theme selection to use the light palette.
Bug Fixes:
Enhancements:
lightclass while keeping the theme toggle and next-themes state aligned.Documentation:
Tests: