Closed DorKeinath closed 2 weeks ago
Hello @DorKeinath, dark mode is handled through CSS imports. An application could be using a static palette or using a palette based on the system preferences.
Status bar style is handled by the JS layer and the Capacitor plugin.
Developers are expected to use the plugin API directly: https://capacitorjs.com/docs/apis/status-bar#setstyle to configure the appearance of the status bar, since the UI library will not have context to this decision in your application.
Thank you @sean-perkins a lot for your answer, it helps me a lot. I came across this option but I thought, why not suggest adding a switch to enable it? It's quite common for users to desire this feature, and currently, each user must individually implement it. Therefore, it would be efficient for them to provide such an option, perhaps within the vsc extention?
@DorKeinath Take a look at capacitor-dark-mode. It handles dark mode in the CSS and in the status bar for you.
I am going to close this feature request as there are alternative solutions that solve this request: https://github.com/ionic-team/ionic-framework/issues/29378#issuecomment-2073441940
Our considerations within Ionic Framework are often different than plugins and solutions that exist outside of it. With dark mode/palettes, we internally discussed and compared solution designs for a JS API to opt-in/out of the feature set. We decided with the CSS-only approach to enable developers to have the least amount of JS overhead and more control over how the feature applies in their application. This allows developers to build plugins and solutions outside of Ionic Framework that may be a perfect fit for scenarios developers find themselves needing.
We appreciate the feature request and ideas on how we may continue to improve Ionic Framework!
Prerequisites
Describe the Feature Request
It would be fantastic if setting the mode to dark also caused the status bar to become dark.
Describe the Use Case
The actual screen looks like this:
Describe Preferred Solution
No response
Describe Alternatives
No response
Related Code
No response
Additional Information
No response