Skip to content

Commit ad24e58

Browse files
committed
fix: resolve #472 — add z-index to Drawer root element
The Drawer component's root element was missing a z-index, causing it to appear behind elements with even a z-index of 1. This fix adds z-index support to the Drawer root container via the --gn-drawer-z-index CSS variable. Changes: - Added z-index: var(--gn-drawer-z-index) to Drawer root element - Updated README to document the new --gn-drawer-z-index CSS variable - No default value provided to avoid breaking existing layouts - Users can set the CSS variable to control stacking order (e.g., 1000)
1 parent f10679f commit ad24e58

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

src/components/Drawer/Drawer.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ $block: '.#{variables.$ns}drawer';
44

55
#{$block} {
66
pointer-events: none;
7+
z-index: var(--gn-drawer-z-index);
78

89
--_--item-shadow-default: 0 1px 5px 0 var(--g-color-sfx-shadow);
910
--_--item-position: fixed;

src/components/Drawer/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ The Drawer module consists of two primary components: `Drawer` and `DrawerItem`.
9999

100100
| Name | Description | Default |
101101
| :-------------------------------------------- | :---------------------------------------------------------- | :-------------------------------------: |
102+
| Drawer | | |
103+
| `--gn-drawer-z-index` | z-index of the drawer root container | `"auto"` |
102104
| DrawerItem | | |
103105
| `--gn-drawer-item-position` | The position of the drawer item on page | `fixed` |
104106
| `--gn-drawer-item-shadow` | The box-shadow of the drawer item when veil is hidden | `0 1px 5px 0 var(--g-color-sfx-shadow)` |

0 commit comments

Comments
 (0)