Open Dimitris-Provatas opened 1 year ago
Why wouldn't you just use @media (prefers-color-scheme: dark)
?
Did not think of that tbh... Haven't tested it, but if it works then it would be a much better and simpler solution! :smiley:
@Dimitris-Provatas is this issue still open. If yes I would like to work on it.
Yes, I never got around on implementing this. Go ahead and work on in if you like. If you need any more input from my side, feel free to ping me!
Good coding and have fun!
The idea is to simply have a
dark_mode.css
file in the same directory as theArchWikiOffline.css
and a button in each page to toggle between light and dark mode. I am not suggesting to try and copy what the live wiki site does, but rather just append some lines of code to each file.I have extracted and written the CSS file needed and a JS function to do that with no page reloads. The code also saves the preference to local storage, so it will persist over closing and opening the browser. Unfortunately, I don't have the time currently to get into the project and make a pull request. I will provide the CSS and JS below for anyone who wants to undertake this.
*.html
dark_mode.css