AndyTaylorTweet / Pi-Star_DV_Dash

Pi-Star DV Dashboard (Based on works by Hans-J. Barthen (DL5DI) and Kim Huebel (DG9VH)).
http://www.pistar.uk/downloads/
111 stars 120 forks source link

Add support for CSS dark mode #173

Open rhymeswithmogul opened 1 year ago

rhymeswithmogul commented 1 year ago

The default Pi-Star color scheme is extremely bright, especially when using it at night. This pull request adds a dark theme using the (prefers-color-scheme) CSS media query, which is supported by almost all web browsers. Thus, if the browser requests a darker color scheme, Pi-Star will adapt.

DarkMode

Note that this pull request does not respect any custom CSS that the user may have specified, nor can it be customized by the end user.

MW0MWZ commented 1 year ago

I'm fine with the idea, but not the implementation, to remove the option to customize the CSS while in dark mode isn't going to work too well.

Can you convert the css file to .php, and swap the references around to call the php version - so that we can add those cusomisation options back please - that way I can extend the CSS config page to also allow the option to cusomize the dark mode color set.

rhymeswithmogul commented 1 year ago

Sure, I'll give that a try. Give me a few days and I'll see what I can do.

MW0MWZ commented 1 year ago

you don't have to get every part done, I just need the files to all point to the .php version of the CSS file you made, and for that to have the headders set to that the webserver serves the flat CSS to the browser. Once you get to that point, I can fill in the rest.

rhymeswithmogul commented 1 year ago

All right, I've done it in the Pi-Star style. The user can customize the colors if they don't like my defaults. Or, if they love light mode, the whole thing can be disabled with a checkbox on the settings page.

image