Possible to get darkmode-js to work with Bubble?

I’m tired of getting my eyes seared by my own apps and I was looking for a lazy way to get darkmode going. I came across darkmode-js and tried it and I can only get it to change the color of the background if you don’t set a background.

Is it possible to make it work?


Here’s what I’ve done to get it to work:

  • add HTML element on page with
<script src="https://cdn.jsdelivr.net/npm/darkmode-js@1.5.7/lib/darkmode-js.min.js"></script>
  • make a button that triggers a run javascript event (yes, you need the Toolbox plugin) which executes
const darkmode =  new Darkmode();
darkmode.toggle();
2 Likes

Looking for anything like that as well - current darkmode best practice (setting a conditional on every element) just cannot be it

1 Like

Not perfect but:

https://sandboxjc.bubbleapps.io/userway
But I’m interested into this library. Will have a look if this can work with Bubble.