-
Notifications
You must be signed in to change notification settings - Fork 20
/
Nav.svelte
42 lines (37 loc) · 816 Bytes
/
Nav.svelte
1
2
3
4
5
6
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
<script>
import {getEventsAction} from './utils';
import {current_component} from 'svelte/internal';
const events = getEventsAction(current_component);
let is_left = ($$props.$$slots.left !== undefined);
let is_center = ($$props.$$slots.center !== undefined);
let is_right = ($$props.$$slots.right !== undefined);
</script>
<nav class:nav={1} use:events {...$$restProps}>
{#if is_left}
<div class="nav-left">
<slot name="left"></slot>
</div>
{/if}
{#if is_center}
<div class="nav-center">
<slot name="center"></slot>
</div>
{/if}
{#if is_right}
<div class="nav-right">
<slot name="right"></slot>
</div>
{/if}
</nav>
<style>
nav{
width:100%;
flex-direction: row;
}
:global(.nav-left) {
justify-content: flex-start
}
:global(.nav-right) {
justify-content: flex-end
}
</style>