Skip to content

Commit c8e9031

Browse files
committed
feat: fix dock styles
1 parent a3be8bf commit c8e9031

4 files changed

Lines changed: 57 additions & 52 deletions

File tree

packages/core/src/client/webcomponents/.generated/css.ts

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

packages/core/src/client/webcomponents/components/DockEdge.vue

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ function togglePositionDropdown() {
6767
],
6868
onClick: () => switchPosition(pos),
6969
}, [
70-
h('div', { class: `${positionIcons[pos]} w-4 h-4` }),
70+
h('div', { class: `${positionIcons[pos]} w-4.5 h-4.5` }),
7171
h('span', positionLabels[pos]),
7272
]),
7373
)),
@@ -190,6 +190,7 @@ const contentClass = computed(() => {
190190
:context="context"
191191
:groups="groupedEntries"
192192
:is-vertical="isVertical"
193+
:rotate="false"
193194
:selected="selectedEntry"
194195
@select="(e) => context.docks.switchEntry(e?.id)"
195196
/>
@@ -206,14 +207,14 @@ const contentClass = computed(() => {
206207
title="Switch edge position"
207208
@click="togglePositionDropdown"
208209
>
209-
<div :class="positionIcons[store.position]" class="w-4 h-4" />
210+
<div :class="positionIcons[store.position]" class="w-4.5 h-4.5" />
210211
</button>
211212
<button
212213
class="p1.5 rounded hover:bg-active transition op50 hover:op100"
213214
title="Switch to float mode"
214215
@click="switchToFloat"
215216
>
216-
<div class="i-ph-cards-three-duotone w-4 h-4" />
217+
<div class="i-ph-cards-three-duotone w-4.5 h-4.5" />
217218
</button>
218219
</div>
219220
</div>

packages/core/src/client/webcomponents/components/DockEntriesWithCategories.vue

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,15 @@ import type { DocksContext } from '@vitejs/devtools-kit/client'
44
import type { DevToolsDockEntriesGrouped } from '../state/dock-settings'
55
import DockEntries from './DockEntries.vue'
66
7-
defineProps<{
7+
withDefaults(defineProps<{
88
context: DocksContext
99
groups: DevToolsDockEntriesGrouped
1010
selected: DevToolsDockEntry | null
1111
isVertical: boolean
12-
}>()
12+
rotate?: boolean
13+
}>(), {
14+
rotate: true,
15+
})
1316
1417
const emit = defineEmits<{
1518
(e: 'select', entry: DevToolsDockEntry): void
@@ -19,12 +22,13 @@ const emit = defineEmits<{
1922
<template>
2023
<template v-for="[category, entries], idx of groups" :key="category">
2124
<slot v-if="idx > 0" name="separator" :category="category" :index="idx" :is-vertical="isVertical">
22-
<div class="border-base m1 h-20px w-px border-r-1.5" />
25+
<div v-if="isVertical" class="border-base m1 w-20px h-px border-b-1.5" />
26+
<div v-else class="border-base m1 h-20px w-px border-r-1.5" />
2327
</slot>
2428
<DockEntries
2529
:context="context"
2630
:entries="entries"
27-
:is-vertical="isVertical"
31+
:is-vertical="isVertical && rotate"
2832
:selected="selected"
2933
@select="(e) => emit('select', e)"
3034
/>

packages/core/src/client/webcomponents/components/ViewBuiltinSettings.vue

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,50 @@ function resetSettings() {
141141
DevTools Settings
142142
</h1>
143143

144+
<section class="border-t border-base pt-6 mb-8">
145+
<h2 class="text-lg font-medium mb-4 op75">
146+
Appearance
147+
</h2>
148+
149+
<div class="flex flex-col gap-3">
150+
<!-- Show iframe address bar toggle -->
151+
<label class="flex items-center gap-3 cursor-pointer group">
152+
<button
153+
class="w-10 h-6 rounded-full transition-colors relative shrink-0"
154+
:class="settings.showIframeAddressBar ? 'bg-lime' : 'bg-gray/30'"
155+
@click="settingsStore.mutate((s) => { s.showIframeAddressBar = !s.showIframeAddressBar })"
156+
>
157+
<div
158+
class="absolute top-1 w-4 h-4 rounded-full bg-white shadow transition-transform"
159+
:class="settings.showIframeAddressBar ? 'translate-x-5' : 'translate-x-1'"
160+
/>
161+
</button>
162+
<div class="flex flex-col">
163+
<span class="text-sm">Show iframe address bar</span>
164+
<span class="text-xs op50">Display navigation controls and URL bar for iframe views</span>
165+
</div>
166+
</label>
167+
168+
<!-- Close on outside click toggle -->
169+
<label class="flex items-center gap-3 cursor-pointer group">
170+
<button
171+
class="w-10 h-6 rounded-full transition-colors relative shrink-0"
172+
:class="settings.closeOnOutsideClick ? 'bg-lime' : 'bg-gray/30'"
173+
@click="settingsStore.mutate((s) => { s.closeOnOutsideClick = !s.closeOnOutsideClick })"
174+
>
175+
<div
176+
class="absolute top-1 w-4 h-4 rounded-full bg-white shadow transition-transform"
177+
:class="settings.closeOnOutsideClick ? 'translate-x-5' : 'translate-x-1'"
178+
/>
179+
</button>
180+
<div class="flex flex-col">
181+
<span class="text-sm">Close panel on outside click</span>
182+
<span class="text-xs op50">Close the DevTools panel when clicking outside of it (embedded mode only)</span>
183+
</div>
184+
</label>
185+
</div>
186+
</section>
187+
144188
<section class="mb-8">
145189
<h2 class="text-lg font-medium mb-4 op75">
146190
Dock Entries
@@ -261,50 +305,6 @@ function resetSettings() {
261305
</div>
262306
</section>
263307

264-
<section class="border-t border-base pt-6 mb-8">
265-
<h2 class="text-lg font-medium mb-4 op75">
266-
Appearance
267-
</h2>
268-
269-
<div class="flex flex-col gap-3">
270-
<!-- Show iframe address bar toggle -->
271-
<label class="flex items-center gap-3 cursor-pointer group">
272-
<button
273-
class="w-10 h-6 rounded-full transition-colors relative shrink-0"
274-
:class="settings.showIframeAddressBar ? 'bg-lime' : 'bg-gray/30'"
275-
@click="settingsStore.mutate((s) => { s.showIframeAddressBar = !s.showIframeAddressBar })"
276-
>
277-
<div
278-
class="absolute top-1 w-4 h-4 rounded-full bg-white shadow transition-transform"
279-
:class="settings.showIframeAddressBar ? 'translate-x-5' : 'translate-x-1'"
280-
/>
281-
</button>
282-
<div class="flex flex-col">
283-
<span class="text-sm">Show iframe address bar</span>
284-
<span class="text-xs op50">Display navigation controls and URL bar for iframe views</span>
285-
</div>
286-
</label>
287-
288-
<!-- Close on outside click toggle -->
289-
<label class="flex items-center gap-3 cursor-pointer group">
290-
<button
291-
class="w-10 h-6 rounded-full transition-colors relative shrink-0"
292-
:class="settings.closeOnOutsideClick ? 'bg-lime' : 'bg-gray/30'"
293-
@click="settingsStore.mutate((s) => { s.closeOnOutsideClick = !s.closeOnOutsideClick })"
294-
>
295-
<div
296-
class="absolute top-1 w-4 h-4 rounded-full bg-white shadow transition-transform"
297-
:class="settings.closeOnOutsideClick ? 'translate-x-5' : 'translate-x-1'"
298-
/>
299-
</button>
300-
<div class="flex flex-col">
301-
<span class="text-sm">Close panel on outside click</span>
302-
<span class="text-xs op50">Close the DevTools panel when clicking outside of it (embedded mode only)</span>
303-
</div>
304-
</label>
305-
</div>
306-
</section>
307-
308308
<section class="border-t border-base pt-6">
309309
<h2 class="text-lg font-medium mb-4 op75">
310310
Reset

0 commit comments

Comments
 (0)