-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Add filter documentation #4444
Add filter documentation #4444
Conversation
✅ Deploy Preview for react-native ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For which versions of RN does this doc apply? I believe that we released these filters and shadows in 0.76, right?
If that's the case, can you apply the same changes to the docs in the website/versioned_docs/version-0.76
folder? 🙏
docs/dropshadowvalue.md
Outdated
|
||
### `offsetX` | ||
|
||
The offset on the x-axis. This can be positive or negative. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Positive means that the dropshadow is skewed toward right, while negative means that it is skewed toward left?
Perhaps is a good idea to specify it, wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does it works with RTL languages? Is it inverted or not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does it works with RTL languages?
Just to chime in here, it is not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ooo yeah good point should add clarity there
docs/dropshadowvalue.md
Outdated
|
||
### `offsetY` | ||
|
||
The offset on the y-axis. This can be positive or negative. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Positive is up and negative is down?
docs/view-style-props.md
Outdated
@@ -309,6 +309,35 @@ Sets the elevation of a view, using Android's underlying [elevation API](https:/ | |||
|
|||
--- | |||
|
|||
### `filter` | |||
|
|||
Adds a graphical filter to the View. This filter is comprised of any number of _filter functions_, which each represent some atomic change to the graphical composition of the View. The complete list of valid filter functions is defined below. `filter` will apply to descendants of the View as well as the View itself. `filter` implies `overflow: hidden`, so descendants will be clipped to fit the bounds of the View. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adds a graphical filter to the View. This filter is comprised of any number of _filter functions_, which each represent some atomic change to the graphical composition of the View. The complete list of valid filter functions is defined below. `filter` will apply to descendants of the View as well as the View itself. `filter` implies `overflow: hidden`, so descendants will be clipped to fit the bounds of the View. | |
Adds a graphical filter to the View. This filter is comprised of any number of _filter functions_, which each represent some atomic change to the graphical composition of the `View`. The complete list of valid filter functions is defined below. `filter` will apply to descendants of the `View` as well as the `View` itself. `filter` implies `overflow: hidden`, so descendants will be clipped to fit the bounds of the `View`. |
docs/view-style-props.md
Outdated
The following filter functions work across all platforms: | ||
|
||
- `brightness`: Changes the brightness of the View. Takes a non-negative number or percentage. | ||
- `opacity`: Changes the opacity, or alpha, of the View. Takes a non-negative number or percentage. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have plans to implement the other filters for iOS as well?
If yes, we should add a box to mention that. If not, we should have a box explaining why we don't have them in iOS and we are not planning to implement them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a theoretical future path by using intermediate SwifUI view, that we haven't yet explored. Doing everything within UIKit ended up being pretty much impossible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would be hesitant on saying that yet. I can explain why we could not get it to work in iOS. Basically we just looked at some SwiftUI code and thought we could get it working.
docs/view-style-props.md
Outdated
|
||
The following filter functions work on Android only: | ||
|
||
- `blur`: Blurs the View with a [Guassian blur](https://en.wikipedia.org/wiki/Gaussian_blur), where the specified length represents the radius used in the blurring algorithm. Any non-negative DIP value is valid (no percents). The larger the value, the blurrier the result. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- `blur`: Blurs the View with a [Guassian blur](https://en.wikipedia.org/wiki/Gaussian_blur), where the specified length represents the radius used in the blurring algorithm. Any non-negative DIP value is valid (no percents). The larger the value, the blurrier the result. | |
- `blur`: Blurs the `View` with a [Guassian blur](https://en.wikipedia.org/wiki/Gaussian_blur), where the specified length represents the radius used in the blurring algorithm. Any non-negative DIP value is valid (no percents). The larger the value, the blurrier the result. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All mention of View
should be backticked in the page as it is a proper RN component.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
General comment, this may be worth adding to versioned docs for 0.76 as well
docs/dropshadowvalue.md
Outdated
|
||
### `offsetX` | ||
|
||
The offset on the x-axis. This can be positive or negative. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does it works with RTL languages?
Just to chime in here, it is not.
docs/view-style-props.md
Outdated
The following filter functions work across all platforms: | ||
|
||
- `brightness`: Changes the brightness of the View. Takes a non-negative number or percentage. | ||
- `opacity`: Changes the opacity, or alpha, of the View. Takes a non-negative number or percentage. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a theoretical future path by using intermediate SwifUI view, that we haven't yet explored. Doing everything within UIKit ended up being pretty much impossible.
|
||
<div class="label basic android">Android</div> | ||
|
||
The following filter functions work on Android only: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When we announced this in the blog post, we had IIRC a table or some disclaimer of min supported Android versions, because blur and drop-shadow only work on recent Android. This may be helpful to add.
@cipolleschi responded to comments! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for updating it! LGTM
tsia! added documentation for filter which was release on 0.76.