Skip to content

Let people choose a light or dark theme, or follow the system - #238

Open
shanesmithdev wants to merge 1 commit into
NativePHP:mainfrom
shanesmithdev:theme-setting
Open

shanesmithdev wants to merge 1 commit into
NativePHP:mainfrom
shanesmithdev:theme-setting

Conversation

@shanesmithdev

@shanesmithdev shanesmithdev commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Sam Shupac (@samshupac) asked on /dev/null for a way to set the app to dark mode himself, rather than only following his iOS setting, and Simon said he was open to PRs.

This adds a Theme section to Account, between Color and Timezone, with System · Light · Dark. System is the default, so nothing changes for anyone who never touches it, and it doesn't force dark mode (the reason #2 was closed).

  • Choosing Light or Dark switches the whole app straight away (bars, sheets and keyboard included) and stays that way after the app restarts. Choosing System hands the app back to the phone.
  • It uses System::setAppearance(), which shipped in NativePHP mobile 4.9.0, so there are no dependency changes.
  • The choice is remembered on the phone so the section opens on it. Like the native setting, it's a choice for this phone, not your account, so signing out keeps it.

Testing

  • ThisDeviceThemeTest covers System by default with no native call, Light and Dark pinning the app and being remembered, System handing back to the phone, an unknown choice being ignored, the section's place on the screen, and the theme surviving sign-out.
  • Checked on an Android phone and the iPhone 17 Pro simulator: each choice switches the app immediately, survives a relaunch, and System follows the device both ways. The Log's bars and wordmark follow the new theme too.

Screenshots

Account, dark mode

Notice how there's a new Theme section between Color and Timezone, with System, Light and Dark. System is selected until you choose something else.

Before After
iOS
Android

Overriding the device

Notice how choosing Light keeps the app light on an Android phone that's set to dark, and choosing Dark keeps it dark on an iPhone that's set to light.

Light, on an Android phone set to dark Dark, on an iPhone set to light

Account has a new Theme section between Color and Timezone, with
System, Light and Dark. System is the default, so nothing changes
for anyone who never touches it.

Choosing Light or Dark switches the whole app straight away, bars,
sheets and keyboard included, and the app stays in that theme after
it restarts. Choosing System makes it follow the phone again. It uses
System::setAppearance() from NativePHP mobile 4.9.0.

The choice belongs to the phone, not the account. It doesn't sync to
the web, and signing in to another account keeps it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant