Skip to content
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

Fix low contrast on downloads graph labels and borders #8679

Merged
merged 2 commits into from
May 19, 2024

Conversation

Turbo87
Copy link
Member

@Turbo87 Turbo87 commented May 19, 2024

Resolves #8675

Unfortunately Chart.js does not natively support any kind of dark mode switching (see chartjs/Chart.js#9214), so we have to implement it ourselves.

The first commit adds a resolvedScheme property to the colorScheme service, which is automatically updated when either the user explicitly switches the color scheme, or the user is on the "System" setting and the OS decides that it's time for a color scheme change.

The second commit then uses {{did-update ...}} to adjust the Chart.js settings and run chart.update() when the resolvedScheme property changes.

Light

Bildschirmfoto 2024-05-19 um 13 27 18

Dark (before)

Bildschirmfoto 2024-05-19 um 13 27 29

Dark (after)

Bildschirmfoto 2024-05-19 um 13 27 12

@Turbo87 Turbo87 added C-bug 🐞 Category: unintended, undesired behavior A-frontend 🐹 labels May 19, 2024
@Turbo87 Turbo87 merged commit 1b1c17a into rust-lang:main May 19, 2024
7 checks passed
@Turbo87 Turbo87 deleted the fix-dark-chart branch May 19, 2024 11:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-frontend 🐹 C-bug 🐞 Category: unintended, undesired behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dark mode download graph labels have very low contrast
1 participant