Commit 691f01d
fix: handle z-index as unitless property (#667)
## Description
### Current behavior:
When setting z-index values in styles, a warning appears stating
"Expected style 'zIndex: 1px' to be unitless". This warning is incorrect
since z-index should be handled as a unitless property. While z-index
has no effect in SVG (as elements are painted in document order), the
warning itself needs to be fixed for better developer experience.
### Changes in this PR:
- Added special case handling for `zIndex` property
- Added clear warning message explaining that z-index is not supported
in SVG
- Improved developer experience by providing more accurate feedback
about SVG limitations
Closes #660
## Test plan
### Before
The floating warning appears in console when setting z-index:
```javascript
style={{
zIndex: 1
}}
```
Shows warning: "Expected style 'zIndex: 1px' to be unitless"

### After
1. Set z-index in styles
2. Verify the correct warning appears: "z-index is not supported in SVG.
Elements are painted in the order they appear in the document."
3. Test with different z-index values
4. Verify the warning is clear and helpful for developers

---------
Co-authored-by: Shu Ding <[email protected]>1 parent 5945f7a commit 691f01d
1 file changed
+7
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
62 | 69 | | |
63 | 70 | | |
64 | 71 | | |
| |||
0 commit comments