Tiny Tiny RSS: Community

Auto night mode switching

I remember this was requested, it was impossible to implement with pure CSS but apparently you can listen on these events with javascript.

the real question is how do I mix this with current theme system without causing colossal meltdowns and butthurt all around over yet another cosmetic issue.

my plan is something like this:

  • toggle night mode manual menu option is gone
  • auto switch is enabled when using default.css
  • add separate light.css which would force light theme just like night.css forces dark one

e: https://git.tt-rss.org/fox/tt-rss/commit/0237dee980157554ab2c9a79b6e9d10cec9e2f3a done

To be honest, as long as there’s a message saying “Hey, default behaviour changed”, it’s fine as far as I am concerned…

so i got auto switched to night mode, when its set to default.css, because of my windows darkmode?
i would say it should be daylight based instead of windows theme based?
and should be on something like autotheme.css instead of default.css

I think this plan is perfect and, IMO, would be expected behavior.


tt-rss is enabling night mode based on browser telling it that user prefers dark theme at this moment. everything else up to and including sunrise and sunset times is up to your browser and/or operating system.

i hope you’re not seriously proposing to add geoip checking into tt-rss to figure out your local sunset time.

this is specifically default behavior so obviously it’s on default.css. if you don’t like it, you were given tools to set either theme.

as user set Time zone in preference it could be easy? my understanding could be wrong.

ok default.css makes sense, i was surprised why my theme turned dark when i didn’t changed anything, and neither does my browser have any dark theme.
i switched to light.css

It’s a lot more complicated than that. Sunrise/set times are literally different every single day of the year, planet rotation and orbit being what they are and all:


There is software to deal with this, of course, but the idea of adding this when an operating system can simply state what the user wants and have that be consistent across supporting applications is a much better solution.

Hmz, I genuinely loved the fact that I could quickly switch to night mode when I continued reading in darker environments, then could switch back easily whenever I wanted to.

I’m not sure “night mode” is synonymous with whether the user prefers a dark mode for apps in Windows, either. I’ve never considered it like that, at least.

This little plugin toggle_night_mode allowed the switch for custom themes as well, something I use every single day.

why not? if you prefer system dark mode it makes sense for everything else to adapt to it too, including web sites, for consistency. that’s why that media query exists in the first place.

on android this is based on sunset/sunrise times by default but it’s still your browser following system theme changes and then websites following what browser tells them (or not).

Because there are people who like dark mode all the time, and those who like to only use it under specific circumstances. With the new behavior, there’s no instant choice between light and dark mode (only a forced light mode).

I would say the automatic switching would be a nice extra option, but if it’s forced, without a quick manual switch, I guess I’ll update the plugin to get back the old behavior.

to me this whole thing is about auto switching while actually in the dark.

i’ve noticed on android apps started autoswitching to dark mode consistently and i felt it was a useful thing to have, so i’ve added similar functionality to the stuff i maintain.

this way ootb behavior seems to follow industry practices (for better or for worse) and edge cases are covered by theme/plugin system.

No worries. toggle_night_mode https://github.com/ltGuillaume/FeedMei/tree/master/plugins.local/ now reintroduces the hotkey to manually switch between day and night mode.

Guess I should force light.css now for the default theme. Fixed. (Total rewrite actually)

I don’t see why not, … and one of the requirements for running tt-rss should be a GPS input to make sure that the local sunset time is ACCURATE. :laughing:

That’s quite the understatement there…

I may be wrong but it seems that i don’t have the theme selection in my automatic darkmode