jpudysz / react-native-unistyles

Level up your React Native StyleSheet

Home Page:https://unistyl.es

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Incomplete color normalization

levibuzolic opened this issue · comments

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

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