Preferred light/dark theme?

Open
#55 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
42/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
android, ios, javascript, react-native
Domain
mobile

Research direction

Start by reviewing React Native's AndroidInfoModule entry point and the Android uiMode and iOS traitCollection.userInterfaceStyle APIs cited in the issue. The work is done when the theme provider can distinguish unspecified, light, and dark preferences on both platforms, with behavior covered by appropriate tests.

Written by the indexing model from the issue text.

Description

Describe the feature

It'd be nice to automatically be able to accommodate a user's preferred light/dark theme preferences.

Perhaps, simplifying the check of uiMode && UI_MODE_NIGHT_MASK on Android and traitCollection.userInterfaceStyle on iOS.

These both have undefined/unspecified, light, and dark/night.

Unfortunately, the built-in react-native uiMode doesn't give this information.

Motivation

With iOS 13 and Android Q making this sort of theming more integrated (and Google and Apple's own apps supporting the ability to switch at the OS level), it'd be nice to automatically detect what theme the user wants.

I'd rather not force a user to fumble through app settings to configure the theme if they've already got an option to specify it at the OS level.

Related Issues

I didn't see any at first glance, but I may have missed them.

Dominant language
JavaScript
Stars
466
Forks
53
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from callstack/react-theme-provider

All issues in callstack/react-theme-provider

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.