Repository navigation
Commit df3cdfd
authored
fix: make elevation shadows on iOS & Web match android more closely (#5062)
### Motivation
On iOS and Web, we manually calculate elevation shadows. They are originally from material-web: #3089
But looking at them side-by-side on all platforms, they look nothing like Android.
This reworks the shadows so they more closely match Android's elevation.
Note that it's an approximation. On Android, the elevation is dynamic and changes based on where the view is. Views toward the bottom have a larger shadow than views toward the top. But we can't achieve it with shadow styles directly, so we need to approximate it.
Also changed the example, as the huge rectangles fit fewer ones on screen and made it harder to see the shadows.
### Known issues
- Animated elevation doesn't work on Web. But it's a pre-existing bug. It should be fixed once we move to Reanimated.
### Test plan
**Before**
<img width="2668" height="1604" alt="elevation-before" src="https://github.com/user-attachments/assets/d127b3e7-d74e-474e-a393-d9385a69e665" />
**After**
<img width="2668" height="1626" alt="elevation-after" src="https://github.com/user-attachments/assets/601fd2cd-94df-4df5-bddd-6be82bdad0e1" />1 parent ea80c26 commit df3cdfd
10 files changed
Lines changed: 416 additions & 237 deletions
File tree
- example/src/Examples
- src
- components
- FAB
- __tests__
- __snapshots__
- theme/tokens/sys
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
2 | 3 | | |
3 | | - | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
8 | 48 | | |
9 | 49 | | |
10 | 50 | | |
11 | 51 | | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
| 52 | + | |
| 53 | + | |
21 | 54 | | |
22 | 55 | | |
23 | 56 | | |
24 | 57 | | |
25 | 58 | | |
26 | 59 | | |
27 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
28 | 65 | | |
29 | 66 | | |
30 | 67 | | |
31 | 68 | | |
32 | 69 | | |
33 | 70 | | |
34 | 71 | | |
35 | | - | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
36 | 77 | | |
37 | 78 | | |
38 | 79 | | |
39 | 80 | | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
40 | 85 | | |
41 | 86 | | |
42 | 87 | | |
| |||
68 | 113 | | |
69 | 114 | | |
70 | 115 | | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
71 | 121 | | |
72 | | - | |
73 | | - | |
74 | | - | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
75 | 125 | | |
76 | 126 | | |
77 | 127 | | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
84 | 131 | | |
85 | | - | |
86 | 132 | | |
87 | 133 | | |
88 | 134 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | | - | |
16 | 14 | | |
17 | 15 | | |
18 | 16 | | |
| |||
79 | 77 | | |
80 | 78 | | |
81 | 79 | | |
| 80 | + | |
82 | 81 | | |
83 | 82 | | |
84 | 83 | | |
| |||
93 | 92 | | |
94 | 93 | | |
95 | 94 | | |
96 | | - | |
| 95 | + | |
97 | 96 | | |
98 | | - | |
| 97 | + | |
99 | 98 | | |
100 | 99 | | |
101 | 100 | | |
| |||
0 commit comments