Skip to content

[0.22] Test that rgb() with a slash alpha survives StyleSheet - #2912

Merged
zoontek merged 1 commit into
necolas:0.22-devfrom
YevheniiKotyrlo:test/normalize-colors-modern-rgb-0.22
Oct 19, 2026
Merged

zoontek merged 1 commit into
necolas:0.22-devfrom
YevheniiKotyrlo:test/normalize-colors-modern-rgb-0.22

Conversation

@YevheniiKotyrlo

Copy link
Copy Markdown

Problem

@react-native/normalize-colors 0.74 returns null for the space-separated form rgb(10 20 30 / 0.4), so processColor answered undefined and the StyleSheet compiler dropped the declaration. #2909 moved 0.22-dev to a version that parses it, but no test covers the form, so a later dependency change could drop it again without a failure.

Tests

  • processColor › should convert rgb(x y z / a)
  • compiler/createReactDOMStyle › colors › rgb() with a slash alpha

Both fail with @react-native/normalize-colors@0.74.89 installed in place of the current dependency (Received: undefined) and pass on 0.22-dev.

Verification

npm run format clean · flow 0 · lint 0 · unit 46 suites, 687 passed, 6 skipped

No open issue or PR covers it: searched the tracker for normalize-colors, rgb slash, color level 4 and rgb space separated.

Related

Follow-up to #2909, as offered there.

Base

0.22-dev 36c0ad78.

@react-native/normalize-colors 0.74 answered null for
rgb(10 20 30 / 0.4), so the StyleSheet compiler dropped the declaration.
0.88, which 0.22-dev depends on, parses it. Cover the form in
processColor and in createReactDOMStyle, where it resolves to
rgba(10,20,30,0.40).
@codesandbox-ci

Copy link
Copy Markdown

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 75037e2:

Sandbox Source
react-native-web-examples Configuration

@YevheniiKotyrlo
YevheniiKotyrlo marked this pull request as ready for review October 18, 2026 19:21
@zoontek
zoontek merged commit 24a6825 into necolas:0.22-dev Oct 19, 2026
6 checks passed
@zoontek

zoontek commented Oct 19, 2026

Copy link
Copy Markdown
Collaborator

Thanks! Merged in 0.22-dev

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