amitmerchant1990 / reverie

:art: A ridiculously elegant Jekyll theme.
https://reverie.pages.dev
MIT License
775 stars 673 forks source link

Dark Mode #32

Open cabhijith opened 3 years ago

cabhijith commented 3 years ago

Hi! Thanks for this! Really good. Is there anyay to get dark mode for this theme, cause I would like the code to match the backgorund of the site. Thanks!

ongyx commented 3 years ago

I have written up some JS that toggles light/dark mode based on your OS setting, and can be toggled manually using a button on the navigation bar: Screenshot (5)

Of course, you can move the button (this line) elsewhere.

Basically, it inverts the colours of the page and then rotates their hues to look nicer.

The meat of the toggling code is in assets/style.js. I will prepare a pull request with these changes, but the code does not persist dark mode (sometimes) across the whole site yet.

I am a Python dev, not a JS dev. Improvements to my fork here is welcome.

ongyx commented 3 years ago

I made some improvements to the toggle (see my comment in the closed PR above)

torbendury commented 2 years ago

If you want to statically go in dark mode and not enable users to toggle it, you might consider editing your stylesheet?

timabell commented 2 days ago

I did this to my fork: https://github.com/timabell/timwise.co.uk/commit/9a9e9849cdfe61ac9634db88790fd26c06c23463