-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Summary Continuation of #2362 introducing highly requested ✨ `FeDropShadow` ✨ filter. This addition is straightforward since it's essentially a shorthand (as specified in the spec) for filters that are already implemented: https://www.w3.org/TR/filter-effects-1/#feDropShadowElement <img width="532" alt="image" src="https://github.com/user-attachments/assets/b221ee4c-d8b0-469b-acb0-71224fb2b1e0"> ## Test Plan Example app -> Filters -> FeDropShadow ## Compatibility | OS | Implemented | | ------- | :---------: | | iOS | ✅ | | macOS | ✅ | | Android | ✅ | | Web | ✅ |
- Loading branch information
Showing
4 changed files
with
88 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import React from 'react'; | ||
import { | ||
Circle, | ||
FeDropShadow, | ||
FeFlood, | ||
Filter, | ||
Rect, | ||
Svg, | ||
} from 'react-native-svg'; | ||
|
||
BasicMDN.title = 'Basic MDN example'; | ||
function BasicMDN() { | ||
return ( | ||
<Svg viewBox="0 0 30 10" width="300" height="100"> | ||
<Filter id="shadow"> | ||
<FeDropShadow dx="0.2" dy="0.4" stdDeviation="0.2" /> | ||
</Filter> | ||
<Filter id="shadow2"> | ||
<FeDropShadow dx="0" dy="0" stdDeviation="5" floodColor="cyan" /> | ||
</Filter> | ||
<Filter id="shadow3"> | ||
<FeDropShadow | ||
dx="-0.8" | ||
dy="-0.8" | ||
stdDeviation="0" | ||
floodColor="pink" | ||
floodOpacity="0.5" | ||
/> | ||
</Filter> | ||
<Circle cx="5" cy="50%" r="4" fill="pink" filter="url(#shadow)" /> | ||
<Circle cx="15" cy="50%" r="4" fill="pink" filter="url(#shadow2)" /> | ||
<Circle cx="25" cy="50%" r="4" fill="pink" filter="url(#shadow3)" /> | ||
</Svg> | ||
); | ||
} | ||
|
||
const icon = ( | ||
<Svg height="30" width="30" viewBox="0 0 140 140"> | ||
<Filter | ||
id="floodFilterIcon" | ||
x="50%" | ||
filterUnits="userSpaceOnUse" | ||
primitiveUnits="userSpaceOnUse"> | ||
<FeFlood | ||
y="-10%" | ||
x="10%" | ||
width="50%" | ||
height="50%" | ||
floodColor="yellow" | ||
floodOpacity="0.5" | ||
/> | ||
</Filter> | ||
<Rect x="0" y="0" width="100" height="100" fill="blue" /> | ||
<Circle cx="50" cy="50" r="40" filter="url(#floodFilterIcon)" /> | ||
</Svg> | ||
); | ||
const samples = [BasicMDN]; | ||
|
||
export {icon, samples}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters