Even with cookies and server rendering, you might still have to do something similar if you aim to support a "system" mode that depends on users' os settings.
The only way to query it is with a media query in the front-end.
This is true for a 'system' mode. Unless browsers send maybe a 'prefers' header relating to dark mode in their intial request, which I don't think they do. That would actually be a great thing for browsers to add!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Or use cookies and do it server side
Even with cookies and server rendering, you might still have to do something similar if you aim to support a "system" mode that depends on users' os settings.
The only way to query it is with a media query in the front-end.
This is true for a 'system' mode. Unless browsers send maybe a 'prefers' header relating to dark mode in their intial request, which I don't think they do. That would actually be a great thing for browsers to add!