mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
676359efd9
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/48912 The implementation of `hwb()` color functions added in https://github.com/facebook/react-native/pull/34600 is pretty flawed. `hwb()` color functions do not allow comma delimited values. So most of the examples in the unit test here will fail to parse on web. Like `hsl()`, these should also allow numeric non-hue components (instead of just %), and angle values for hue (instead of just numbers), and this is also missing support for alpha values, though these are less dangerous compared to allowing and encouraging incorrect delimiters. https://www.w3.org/TR/css-color-4/#the-hwb-notation These were added for web compat, and the examples fail to parse on web, so I'm opting to just remove this incorrect support before implementing this more correctly in the Fabric CSS parser in next diff. I did not attempt to fix the other issues I discovered with the PR implementation in the last couple diffs, around mixing and matching syntax allowed in legacy/modern, along with allowing inconsistent delimiters. Changelog: [General][Breaking] - Remove incorrect hwb() syntax support from normalize-color Reviewed By: lenaic Differential Revision: D68591172 fbshipit-source-id: 36d670b096ae9fac4bc24938877ad083d4dd336a
@react-native/normalize-colors
Installation
yarn add --dev @react-native/normalize-colors
Note: We're using yarn to install deps. Feel free to change commands to use npm 3+ and npx if you like
Testing
To run the tests in this package, run the following commands from the React Native root folder:
yarnto install the dependencies. You just need to run this onceyarn jest packages/normalize-color.