Some users have been asking about automatic switching between a light and a dark theme. Could this be accomplished with a plugin?
I assume this would need two parts:
a theme component with a javascript switching themes based on local time
a Discourse plugin adding options to the user preferences page:
turn night mode switching on/off, choose nighttime theme, set time nighttime time period
How difficult would it be to code? As in, how much would it cost?
I don’t think we support custom user fields in themes at the moment. I do see the use case for them though, it’s nice to be able to ship a theme component with a user-configurable setting.
There is a fairly hacky workaround, to add a field in the UI only and then store the data in local storage or the session. That’s what I did on the experimental automatic dark mode switch for Safari, you can look at the code of that component to see how it’s done.