Skip to content

feat(ios): support backgroundImage layering#192

Open
V3RON wants to merge 5 commits into
mainfrom
feat/ios-background-image-layering
Open

feat(ios): support backgroundImage layering#192
V3RON wants to merge 5 commits into
mainfrom
feat/ios-background-image-layering

Conversation

@V3RON

@V3RON V3RON commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

What is this?

This PR adds a first-class backgroundImage style prop on iOS so gradient overlays behave like Android and like web users expect. It keeps existing backgroundColor gradient support for backward compatibility, but backgroundImage now acts as the dedicated overlay layer.

How does it work?

The iOS style converter now reads both backgroundColor and backgroundImage into separate decoration slots. The renderer paints them in order so backgroundColor acts as the base layer and backgroundImage renders on top, including semitransparent gradients. LinearGradient components also populate backgroundImage, and chart styling preserves the same layering path.

Why is this useful?

  • Web-style gradient usage maps to the prop name people expect.
  • Existing iOS content keeps working because backgroundColor gradient strings are still supported.
  • Solid or adaptive base colors can sit behind translucent gradients without extra wrapper views.
  • iOS and Android now share the same mental model for gradient layering.

V3RON added 5 commits June 11, 2026 14:01
Add a separate backgroundImage layer on iOS, preserve backgroundColor compatibility, and document the layering behavior.
Update iOS styling docs to show backgroundImage as the primary gradient prop while keeping backgroundColor gradient usage documented for compatibility.
Keep the compatibility note but avoid showing backgroundColor gradient usage now that backgroundImage is the preferred API.
Replace the internal ZStack background layering with ordered SwiftUI background modifiers while preserving backgroundColor behind backgroundImage.
Update the iOS gradient playground to exercise backgroundImage and add a composed background section combining backgroundColor with a translucent gradient layer.
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