Skip to content

Unstyled text and icons render opaque black, invisible in dark mode (iOS + Android) #89

Description

@sandermj

Package: nativephp/mobile-ui 0.4.0, reproduces on current main
Platforms: iOS 26 and Android

A PR follows this issue.

Steps to reproduce

<column class="bg-zinc-950 p-4">
    <text>Hello</text>
    <icon name="house" />
</column>

Expected: readable text and icon in the platform's primary / on-surface colour, which is what the renderers' own fall-through intends.

Actual: both are pure black on both platforms. On Android, composed text (runs with spans) is black as well.

Cause

NativeUITextRenderer.swift, NativeUIIconRenderer.swift, TextRenderer.kt and IconRenderer.kt read the color prop with a default of 0xFF000000. Each contains a branch that falls through to .primary (iOS) or theme.onSurface (Android) when the colour is 0, but that branch can never run because the default is never 0.

Proposed fix

Default the prop to 0 so the existing fall-through applies. For composed text, leave run colours unspecified when unset so the enclosing Text supplies on-surface. Text and icons with an explicit colour class are unaffected.

Files involved

resources/ios/NativeUITextRenderer.swift, resources/ios/NativeUIIconRenderer.swift, resources/android/TextRenderer.kt, resources/android/IconRenderer.kt.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions