Skip to content

Commit 57aa5f7

Browse files
committed
feat: use vuetify switch for error toggle
1 parent 3c6c9dd commit 57aa5f7

File tree

1 file changed

+7
-37
lines changed

1 file changed

+7
-37
lines changed

src/editor/MessageToggle.vue

Lines changed: 7 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -3,56 +3,26 @@ const visible = defineModel<boolean>()
33
</script>
44

55
<template>
6-
<div class="wrapper" @click="visible = !visible">
7-
<span>Show Error</span>
8-
<div class="toggle" :class="[{ active: modelValue }]">
9-
<div class="indicator" />
10-
</div>
6+
<div class="wrapper" @click.self="visible = !visible">
7+
<v-switch v-model="visible" label="Show errors" color="primary" inset hide-details density="compact"></v-switch>
118
</div>
129
</template>
1310

1411
<style scoped>
1512
.wrapper {
1613
position: absolute;
1714
bottom: 8px;
18-
right: 15px;
15+
right: 24px;
1916
z-index: 11;
2017
display: flex;
2118
align-items: center;
2219
background-color: var(--bg);
2320
color: var(--text-light);
2421
cursor: pointer;
25-
padding: 4px 8px;
26-
border-radius: 2px;
22+
padding: 4px 12px;
23+
border-radius: 16px;
2724
user-select: none;
28-
}
29-
.toggle {
30-
display: inline-block;
31-
margin-left: 4px;
32-
width: 32px;
33-
height: 18px;
34-
border-radius: 12px;
35-
position: relative;
36-
background-color: var(--border);
37-
}
38-
39-
.indicator {
40-
font-size: 12px;
41-
background-color: var(--text-light);
42-
width: 14px;
43-
height: 14px;
44-
border-radius: 50%;
45-
transition: transform ease-in-out 0.2s;
46-
position: absolute;
47-
left: 2px;
48-
top: 2px;
49-
color: var(--bg);
50-
text-align: center;
51-
}
52-
53-
.active .indicator {
54-
background-color: var(--color-branding);
55-
transform: translateX(14px);
56-
color: white;
25+
transform: scale(0.85);
26+
transform-origin: right;
5727
}
5828
</style>

0 commit comments

Comments
 (0)