There already is a github page demo, look at the description of the github project or at the "Demo available" badge. I'll probably change the demo in the next update, it is too simple and ugly. Thanks for the feedback.
I understand the concept of what you are doing, but I think those two methods have different use cases, yours may be more performant but mine, I feel, is more simple for everyday usage. I'll definitly look your work more in depth. Thanks for the feedback!
I was also a bit confused as to why the title was "DarkMode Made Easy", especially since your example just showed adjusting CSS variables. I would assume anyone who's working with CSS variables, also knows about media queries, so it's far easier to just do it all in CSS.
Where I could see this being useful is that you have a callback that you can use, so when dark mode is enabled, you can make some other adjustments when needed.
You'll have a callback on the next version. I plan a lot of tweaks and features that can hardly be done only in CSS, moreover the plan is to give devs an easy way to do dark-modes. I understand the divergences and critics but want to try things as a student. I thanks you a lot for your review.
I honestly recommend writing your own. The code is presently close to trivial, and if you write such a thing yourself you can take it in the direction that suits your requirements.
This API do not invert colors, it uses CSS variables and classes for more customization. No mix-blend-mode or anything. The demo has been done quickly this afternoon, I'll probably change it for the next version.
Darkmode.js uses `mix-blend-mode` to invert the colors on the pages and offer a class based custom style system.
Here you also have the class based custom styles but also have a CSS variables based styling system.
You can chose what value will take a variable depending on the current state of the darkmode.
See the readme of the github page for more informations, ask again if you need additional informations.
The use case is different, the standard CSS `prefers-color-scheme` media feature changes the styles according to your system preferences. Here, the goal is to offer to the developer a simple API to create a customizable darkmode feature. I've just started writing this API but I intend to make it more customizable by including `prefers-color-scheme` option and timestamps based darkmode.