Closed
Description
Edit: A more general proposal has been posted by @tom-un to support generic platform defined colors. Jump to that proposal. That proposal now supersedes the one in this top post.
Original Proposal
### Introduction
Android Q introduced a Dark theme across the system and applications. From their presentation, "Users will expect apps to have a dark theme". The way we do styling on RN today isn't directly compatible with their solution, but it's close.
The Core of It
I opened facebook/react-native#24790 with a proposed solution, but it admittedly had some issues:
- It was on
Platform
, but it's more prone to change than the rest of those values - It closely followed Android's implementation, but doesn't anticipate what iOS or out-of-tree platforms might use
- Android normally recreates the activities when this value changes, but that isn't a safe way to lead to re-rendering (which would be common if the user has enabled it by time-of-day or as part of battery saver)
Discussion Points
- What's a better home for this than
Platform
? While it is a device setting, it's not quite in the same class as things likeVersion
. - Should we stick with the interface that we know (Android's) or anticipate a more universal solution using perhaps https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme