Add support for box-shadow and filter properties#200
Add support for box-shadow and filter properties#200wojtekmaj wants to merge 2 commits intostyled-components:masterfrom
Conversation
d6e7c31 to
38b59c4
Compare
There was a problem hiding this comment.
Pull request overview
This PR updates the CSS-to-React-Native transform behavior to align with newer React Native (>= 0.76) support for box-shadow and filter by passing them through as native style props instead of transforming box-shadow into legacy shadow* fields.
Changes:
- Removes the
boxShadowshorthand transform sobox-shadowis treated as a raw, camelCased prop (boxShadow). - Adds/updates tests to assert pass-through behavior for
filterandbox-shadow, including multiple values. - Updates README guidance to reflect the new pass-through behavior and RN version dependency.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
src/transforms/index.js |
Stops registering the boxShadow transform so box-shadow is no longer expanded into shadow* props. |
src/transforms/boxShadow.js |
Deletes the legacy box-shadow parsing/expansion implementation. |
src/__tests__/units.js |
Updates the units test expectation for box-shadow to match pass-through behavior. |
src/__tests__/index.js |
Adds test coverage for raw pass-through of filter and box-shadow (including multiple functions/values). |
src/__tests__/boxShadow.js |
Removes tests that validated the old box-shadow -> shadow* expansion behavior. |
README.md |
Updates documentation to describe pass-through behavior for box-shadow and filter. |
.DS_Store |
Adds an unintended macOS metadata file to the repo. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
I think this is fine to get in, but would be a breaking change. If you bump the version number, we can merge. Then we'd need a separate PR in styled-components to bump the dependency version |
c5793be to
c26ea69
Compare
|
@jacobp100 Done! I wasn't sure how you wanted to manage this, hence I left that part out before. |
|
One conflict @mxstbr Are you still doing releases - or know who would do a release? |
React Native supports box-shadow and filter properties natively since version 0.76. This means that every version of React Native that is stil supported can benefit from box-shadow and filter properties.
c26ea69 to
0c0a79a
Compare
|
Zero conflicts 😎 |
Closes #195
React Native supports box-shadow and filter properties natively since version 0.76. This means that every version of React Native that is stil supported can benefit from box-shadow and filter properties.
This may be considered a breaking change, since this drops support for React Native 0.75 and older - at the benefit of supporting newer versions, on which styling is currently broken.
How I tested it?
Before:
After: