Skip to content

Commit 93b16eb

Browse files
committed
oops
1 parent 79f525c commit 93b16eb

File tree

3 files changed

+93
-0
lines changed

3 files changed

+93
-0
lines changed
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
<script lang="ts">
2+
import { Checkbox, Dropdown, HoverMenu, Icon } from '@sveltejs/site-kit/components';
3+
import { get_repl_context } from '../context';
4+
5+
let { can_migrate }: { can_migrate: boolean } = $props();
6+
7+
const { migrate, workspace } = get_repl_context();
8+
</script>
9+
10+
<Dropdown align="right">
11+
<div class="target">
12+
<span class="wrench" role="presentation"></span>
13+
<Icon name="chevron-down" />
14+
</div>
15+
16+
{#snippet dropdown()}
17+
<div class="container">
18+
<HoverMenu>
19+
<label class="option">
20+
<span>Toggle Vim mode</span>
21+
<Checkbox bind:checked={workspace.vim}></Checkbox>
22+
</label>
23+
24+
<button disabled={!can_migrate} onclick={migrate}>Migrate to Svelte 5, if possible</button>
25+
</HoverMenu>
26+
</div>
27+
{/snippet}
28+
</Dropdown>
29+
30+
<style>
31+
.target {
32+
text-transform: uppercase;
33+
font: var(--sk-font-ui-small);
34+
position: relative;
35+
display: flex;
36+
align-items: center;
37+
38+
height: 100%;
39+
padding: 0 0.8rem;
40+
gap: 0.5rem;
41+
z-index: 2;
42+
}
43+
44+
span.wrench {
45+
--icon-size: 1.8rem;
46+
width: 1.8rem;
47+
height: 1.8rem;
48+
z-index: 9999;
49+
background: url(./wrench-light.svg) no-repeat 50% 50%;
50+
background-size: contain;
51+
52+
:root.dark {
53+
background-image: url(./wrench-light.svg);
54+
}
55+
}
56+
57+
.container {
58+
position: relative;
59+
right: -2rem;
60+
}
61+
62+
label.option {
63+
display: flex;
64+
align-items: center;
65+
justify-content: space-between;
66+
}
67+
</style>
Lines changed: 13 additions & 0 deletions
Loading
Lines changed: 13 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)