Skip to content
This repository was archived by the owner on Sep 26, 2022. It is now read-only.

Commit f58b58c

Browse files
feat: add NavDrawer z-index prop
Signed-off-by: Florian-Schoenherr <[email protected]>
1 parent 7e1b527 commit f58b58c

File tree

4 files changed

+24
-5
lines changed

4 files changed

+24
-5
lines changed

packages/api-generator/src/NavigationDrawer.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,21 @@
195195
"type": "any"
196196
}
197197
},
198+
{
199+
"visibility": "public",
200+
"description": null,
201+
"keywords": [],
202+
"name": "index",
203+
"kind": "let",
204+
"static": false,
205+
"readonly": false,
206+
"type": {
207+
"kind": "type",
208+
"text": "number",
209+
"type": "number"
210+
},
211+
"defaultValue": 4
212+
},
198213
{
199214
"visibility": "public",
200215
"description": null,

packages/svelte-materialify/@types/NavigationDrawer.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ interface NavigationDrawerProps {
2828
transition?: (node: Element, options: any) => TransitionConfig;
2929
/** options for the transition */
3030
transitionOpts?: any;
31+
/** The z-index of the drawer */
32+
index?: number;
3133
/** styles added to the drawer */
3234
style?: string;
3335
}

packages/svelte-materialify/src/components/NavigationDrawer/NavigationDrawer.scss

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,10 @@
3838

3939
&.fixed {
4040
position: fixed;
41-
z-index: 6;
4241
}
4342

4443
&.absolute {
4544
position: absolute;
46-
z-index: 2;
4745
}
4846

4947
&.right {
@@ -66,7 +64,6 @@
6664
}
6765

6866
&.clipped {
69-
z-index: 4;
7067
top: var(--s-nav-clipped-height);
7168
max-height: calc(100% - var(--s-nav-clipped-height));
7269
}

packages/svelte-materialify/src/components/NavigationDrawer/NavigationDrawer.svelte

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
export let clippedHeight = '56px';
1717
export let transition = fade;
1818
export let transitionOpts = {};
19+
export let index = 4;
1920
export let style = null;
2021
</script>
2122

@@ -32,8 +33,12 @@
3233
class:mini
3334
class:clipped
3435
on:hover
35-
use:Style={{ 'nav-width': width, 'nav-min-width': miniWidth, 'nav-clipped-height': clippedHeight }}
36-
{style}>
36+
use:Style={{
37+
'nav-width': width,
38+
'nav-min-width': miniWidth,
39+
'nav-clipped-height': clippedHeight,
40+
}}
41+
style="z-index:{index};{style}">
3742
<slot name="prepend" />
3843
<div class="s-navigation-drawer__content">
3944
<slot />

0 commit comments

Comments
 (0)