Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: enforce_theme=default Disables Browser-Based Dark/Light Mode Detection #46217

Open
4 of 8 tasks
bromiesTM opened this issue Jul 1, 2024 · 7 comments
Open
4 of 8 tasks
Labels
1. to develop Accepted and waiting to be taken care of 29-feedback bug design Design, UI, UX, etc. feature: theming

Comments

@bromiesTM
Copy link

bromiesTM commented Jul 1, 2024

⚠️ This issue respects the following points: ⚠️

Bug description

When the enforce_theme parameter in config.php is set to default, Nextcloud does not automatically adjust the theme (dark mode or light mode) based on the browser's settings.

Steps to reproduce

  1. Set the enforce_theme parameter in config.php to default:
  2. Open Nextcloud in Browser and confirm default theme is enforced at settings/user/theming
  3. Observe that Nextcloud does not change its theme based on the browser's theme settings. (Dev Tools ⇾ Rendering ⇾ Emulate CSS media feature prefers-color-scheme)

Expected behavior

Nextcloud should automatically switch between dark mode and light mode based on the browser's theme settings when the enforce_theme parameter is set to default.

Installation method

None

Nextcloud Server version

29

Operating system

None

PHP engine version

None

Web server

None

Database engine version

None

Is this bug present after an update or on a fresh install?

None

Are you using the Nextcloud Server Encryption module?

None

What user-backends are you using?

  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other

Configuration report

No response

List of activated Apps

No response

Nextcloud Signing status

No response

Nextcloud Logs

No response

Additional info

No response

@bromiesTM bromiesTM added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Jul 1, 2024
@kesselb
Copy link
Contributor

kesselb commented Jul 1, 2024

cc @susnux @skjnldsv

@germelmann germelmann added 1. to develop Accepted and waiting to be taken care of design Design, UI, UX, etc. and removed 0. Needs triage Pending check for reproducibility or if it fits our roadmap labels Jul 2, 2024
@skjnldsv
Copy link
Member

skjnldsv commented Jul 3, 2024

Ah, we should just remove default from the example in config.sample.php.
Default is not a valid theme, enforcing it makes zero sense :)

@pandusen
Copy link

pandusen commented Jul 16, 2024

Ah, we should just remove default from the example in config.sample.php. Default is not a valid theme, enforcing it makes zero sense :) <

Currently it does make sense. It is the only way to force browser based choice of theme. for me, that makes sense, as I am using a custom theme, that is designed to work in dark and light mode.

If I force either dark or light, it will overwrite the theme completely.
If I dont set any value, the users will be able to change the theme.

@skjnldsv
Copy link
Member

custom theme as within the themes directory of your Nextcloud root?

@pandusen
Copy link

custom theme as within the themes directory of your Nextcloud root?
<

Correct. It used to be that you could just write your theme name "my_theme" directly in "enforce_theme" to apply the theme, and disable user theming. But as always with nextcloud, admin control is slowly getting deprecated.. Now you can only use the build-in themes: dark, dark-highcontrast, default, light, light-highcontrast, opendyslexic. Where default is the current theme.

@bromiesTM
Copy link
Author

Exactly, that's why enforcing default should prevent the non-privileged user from switching themes manually while preserving the auto-adjusting functionality based on browser / OS settings.
At least that's what I expected.

@skjnldsv
Copy link
Member

@pandusen yeah, the custom theming feature you're using is slowly getting deprecated for a few years now.
I would no rely on it on the long run, sorry :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1. to develop Accepted and waiting to be taken care of 29-feedback bug design Design, UI, UX, etc. feature: theming
Projects
None yet
Development

No branches or pull requests

6 participants