diff --git a/apps/accessibility/src/accessibilityoca.js b/apps/accessibility/src/accessibilityoca.js index 8569375c2027f..07ac5d1080a4a 100644 --- a/apps/accessibility/src/accessibilityoca.js +++ b/apps/accessibility/src/accessibilityoca.js @@ -24,8 +24,19 @@ import { loadState } from '@nextcloud/initial-state' OCA.Accessibility = loadState('accessibility', 'data') -if (OCA.Accessibility.checkMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) { - // Overwrite the theme for Guests based on the prefers-color-scheme +// Force a specific theme for guests based on force-color-scheme param +var srv_url = new URL(window.location.href) +var force_color_scheme = srv_url.searchParams.get("force-color-scheme") +if(force_color_scheme !== null) { + if(force_color_scheme=="dark") { + OCA.Accessibility.theme = 'dark' + } + else { + OCA.Accessibility.theme = 'light' + } +} +else if (OCA.Accessibility.checkMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) { + // Overwrite the theme for guests based on the prefers-color-scheme OCA.Accessibility.theme = 'dark' }