Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incomplete color normalization #52

Closed
levibuzolic opened this issue Oct 30, 2023 · 1 comment · Fixed by #53
Closed

Incomplete color normalization #52

levibuzolic opened this issue Oct 30, 2023 · 1 comment · Fixed by #53

Comments

@levibuzolic
Copy link
Contributor

levibuzolic commented Oct 30, 2023

Description

The new color normalization added in #50 has broken react-native-web shadow styling for some colour formats.

// for now supports
// hex colors (3, 6, 8) chars
// colors like orange red etc.

Based on the comments in the commit it looks like it's known that it's an incomplete implementation.

I imagine to stay in-sync with what React Native itself supports, it'd make sense to add a peerDependency to @react-native/normalize-colors which is the underlying utility library that React Native uses to pre-parse colours and then mix-in the alpha channel where required.

I'd be happy to create a PR with that implementation if that approach is suitable.

Steps to reproduce

  1. Use a shadowColor of black with an opacity of 0.5
  2. Observe output colour is black without opacity

Snack or a link to a repository (optional)

No response

Unistyles version

1.1.0

React Native version

0.72.6

Platforms

React Native Web

@jpudysz
Copy link
Owner

jpudysz commented Oct 30, 2023

I wasn't aware of that! I also didn't know about this lib. I will happily accept the PR 🙏

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 a pull request may close this issue.

2 participants