simonbrunel / vuepress-theme-chartjs

VuePress theme for projects in the Chart.js organization.
https://vuepress-theme-chartjs.netlify.app/
MIT License
5 stars 1 forks source link

Feature: Add dark mode (prefers-dark-mode) #2

Open kurkle opened 3 years ago

kurkle commented 3 years ago

Could maybe be based on https://github.com/tolking/vuepress-theme-default-prefers-color-scheme

simonbrunel commented 3 years ago

It may not be as trivial as you suggest since I'm not sure how well it will work with embedded charts which would need to support different colors based on this dynamic light/dark query (see below). I will probably not have time to invest in this feature soon but actually, I'm not even sure I want to deal with different themes in the datalabels docs.

Since there is already a plugin for it, why not just use it directly in the docs you need it?

I just realized that it's not a plugin! (while it's written "This plugin adds support for prefers-color-scheme...")

image

kurkle commented 3 years ago

Ideally I'd like https://chartjs.org/docs to behave based on the user preference. Could allow overriding light, so not every site needs to support it. Chart colors would need to be changed based on the mode, but I'd not expect that to be done by the theme.