Hacker Newsnew | past | comments | ask | show | jobs | submit | Call_in's commentslogin

Oh! Thanks for that, I'll fix the typo when I've got time


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.


Don’t get me wrong, it’s great. Just that with the current examples it’s not that useful to me. Callbacks would be cool!


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.


You have a badge "Demo Available" too, I'll maybe do a more clear link.


I'll do that for the next version, it is already planned, thanks for the feedback!


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.


It makes the creation and management of dark modes simpler, by giving you a simple API to work with.

It does not use `prefer-color-scheme` for now but I'm planning to add the option later.


Thanks, feel free to give feedback, submit issues and contribute if you want!


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.

I hope it make the thing more clear.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: