-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Automatic dark/light theme selection based on browser theme #3180
Comments
Hello @pubmikeb , I am happy to share that this functionality is already implemented and will come with version 1.88 of ui5. Best regards, |
@terezamch I guess you refer to b917c25 which implements theme auto-switching for the SDK / Demokit and which can already be seen on https://openui5nightly.hana.ondemand.com. I'm not sure whether this is what @pubmikeb was looking for. To my understanding, he expected this to be a generic feature of the UI5 library itself, not of the SDK. AFAIK, there's no such feature planned for the runtime alone. |
@codeworrior, thanks for the prompt response. Hopefully, this feature will be added to the roadmap. |
Here is a workaround. |
@CruciformHawk7, great job! |
Hi @pubmikeb, we've discussed this feature enhancement and it will be an awesome feature. Any progress of the implementation will be published here. |
This enhancement will be developed in backlog item FIORITECHP1-24616. |
Hi @pubmikeb, in the meantime UI5 supports an automatic detection of your operation systems dark mode: However there is a caveat with some things to consider: If a theme is configured, UI5 will still take it as-is. The reason is simply compatibility. Now if no theme is configured though: The defaulting for unknown themes, as well as the dark-mode detection, is available in all long term supported minor versions:
Please be aware that only the latest patches of the respective releases contain said feature. Best regards, Thor |
@Thodd, thanks for implementing this feature. However, the following note:
significantly limits the way this feature can be used. For instance, if I want that my app will use It would be great to add ability to specify the logic this feature works somewhere in manifest.json. |
Removing I.e. if the app runs e.g. with the next 1.108 patch release that contains the change dcb529c and without the For older releases where the Horizon theme is not available yet, the next available default theme will be applied, e.g. a Quartz theme ( Similar idea in UI5 Tooling: SAP/ui5-tooling#864 |
@boghyon, thanks for clarification. The initial idea behind this feature request was that a developer sets a theme for the app, and the UI5 engine decides which version (light/dark) of the selected theme to show to the specific user. Currently, this works only if I don't specify a theme at all, but I want to be able to benefit from this feature even if I specify the particular theme. Let say, I set I would expect an option to enable/disable automatic light/dark mode switcher in manifest.json: autoLightDarkUIModeSelector: true/false |
It would be great if UI5 could decided which version of a theme (dark/light) to use based on browser's theme.
Just like it works at StackOverflow and GitHub.
The text was updated successfully, but these errors were encountered: