Skip to content

fix(core): iOS box-shadow alpha was applied twice - #11407

Open
NathanWalker wants to merge 1 commit into
mainfrom
fix/ios-box-shadow-alpha
Open

NathanWalker wants to merge 1 commit into
mainfrom
fix/ios-box-shadow-alpha

Conversation

@NathanWalker

Copy link
Copy Markdown
Contributor

drawBoxShadow in ui/styling/background.ios.ts sets shadowLayer.shadowOpacity from the CSS color's alpha and then also assigns shadowLayer.shadowColor from the same Color, whose CGColor still carries that alpha. Core Animation multiplies the two, so the effective opacity is the alpha squared: rgba(0, 0, 0, 0.3) renders at 0.09, and the subtle values designs actually use (0.08 to 0.15) are effectively invisible.

Fix

Pass the color opaque (colorWithAlphaComponent(1)) so the alpha lives in shadowOpacity alone. shadowOpacity still reflects the CSS alpha, so nothing that reads it changes.

The shadow layer's opacity is set from the color's alpha, and the same
color, alpha included, was also handed to shadowColor — so a CSS
rgba(0, 0, 0, 0.3) shadow rendered at 0.09 and the usual subtle values
were all but invisible. The color is now passed opaque and the alpha lives
in shadowOpacity alone.
@nx-cloud

nx-cloud Bot commented Sep 2, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 8b4d0f0

Command Status Duration Result
nx test apps-automated -c=android ✅ Succeeded 3m 41s View ↗
nx run-many --target=test --configuration=ci --... ✅ Succeeded <1s View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-09-02 13:34:59 UTC

@pkg-pr-new

pkg-pr-new Bot commented Sep 2, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@nativescript/core@11407
npm i https://pkg.pr.new/@nativescript/vite@11407
npm i https://pkg.pr.new/@nativescript/webpack@11407

commit: 8b4d0f0

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.

2 participants