hugo-sid / hugo-blog-awesome

Fast, minimal blog with dark mode support.
https://hba.sid.one
MIT License
430 stars 159 forks source link

Dark theme doesn't work when using Mullvad browser (based on tor browser) with security slider at anything other than "standard" #50

Closed AmyMoriyama closed 1 year ago

AmyMoriyama commented 1 year ago

Describe the bug A clear and concise description of what the bug is. When using the Mullvad browser (basically tor browser without the tor stuff, so this probably applies to tor browser too), the default theme is always light even when set to dark if the security slider is set to anything other than "standard".

Steps to reproduce Steps to reproduce the behavior:

  1. Get Mullvad browser: https://mullvad.net/en/download/browser/linux
  2. Extract, execute
  3. Set security slider to anything other than standard
  4. MY EYES o_o

Expected behavior I would think the security slider would have no effect on whether a site theme is dark or light.

Screenshots If applicable, add screenshots to help explain your problem. n/a

Device information (please complete the following information): cat /etc/os-release PRETTY_NAME="Debian GNU/Linux 11 (bullseye)" NAME="Debian GNU/Linux" VERSION_ID="11" VERSION="11 (bullseye)" VERSION_CODENAME=bullseye ID=debian HOME_URL="https://www.debian.org/" SUPPORT_URL="https://www.debian.org/support" BUG_REPORT_URL="https://bugs.debian.org/"

Mullvad browser: 12.0.6 (based on Mozilla Firefox 102.11.0esr) (64-bit)

Additional context Add any other context about the problem here. Trying to get a simple and fast website that is dark and doesn't need javascript. Which reminds me, seems javascript still is included in the public website even when configured not to be used. Of course, I am new to this whole hugo thing so could be user error.

hugo-sid commented 1 year ago

Thanks for reporting this bug @AmyMoriyama.

I guess when the security slider is set to anything other than "standard", scripts are blocked. Can you confirm this?

Trying to get a simple and fast website that is dark and doesn't need JavaScript. Which reminds me, seems JavaScript still is included in the public website even when configured not to be used.

This theme uses JavaScript to implement several features.

kusyka911 commented 1 year ago

As far as I know privacy oriented browsers (brave, mullvad etc.) prevent detecting system-level dark mode. And in case JS is disabled in your browser you will not be able to switch theme manually. Probably there is ability to enable dark-mode detection on browser flags page (not settings) chrome://flags for chrome based or about:config for firefox based. Or you can set dark mode by default in theme configuration for your website.

As an option we can add configuration param to hide theme switching button. So you can configure your website to hide theme switcher and use theme in dark only mode.

AmyMoriyama commented 1 year ago

Or you can set dark mode by default in theme configuration for your website.

I tried that. Either I changed the wrong thing or it still defaults to light theme even when set to dark. And yes, the website is meant to be loaded without javascript needed.

github-actions[bot] commented 1 year ago

This issue has been marked stale due to inactivity. It will auto-close in 7 days without an update.

github-actions[bot] commented 1 year ago

This issue was auto-closed due to inactivity.

kusyka911 commented 1 year ago

Or you can set dark mode by default in theme configuration for your website.

@AmyMoriyama I'm sorry for long response time. This wasn't working correctly. Even when you set default color to dark, it's still using theme detection in no-script browsers. I've made a PR to fix this. #85