related to : How to detect if the OS is in dark mode in browsers?
Currently you can use stylesheets to determine if the user prefers dark mode or light mode using a media query.
For example:
/* Dark mode */
@media (prefers-color-scheme: dark) {
body {
background-color: #000;
color: white;
}
}
But, is there a way to do it server side in PHP so I can assign class (example: replace bootstrap's "bg-light" class with "bg-dark" when outputting the page) instead of trying to override the possible color classes for all cases