Skip to content

Commit 4cbbefc

Browse files
authored
fix(dock): use position-aware borders and layout for edge panel (#364)
1 parent e7fb1e4 commit 4cbbefc

2 files changed

Lines changed: 29 additions & 5 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/dock/DockEdge.vue

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,34 @@ const panelStyle = computed<CSSProperties>(() => {
161161
return style
162162
})
163163
164+
const panelLayoutClass = computed(() => {
165+
switch (store.position) {
166+
case 'bottom':
167+
return 'flex flex-col-reverse'
168+
case 'top':
169+
return 'flex flex-col'
170+
case 'left':
171+
return 'flex flex-row'
172+
case 'right':
173+
return 'flex flex-row-reverse'
174+
default:
175+
return 'flex flex-col-reverse'
176+
}
177+
})
178+
164179
const toolbarClass = computed(() => {
165-
return isVertical.value
166-
? 'flex-col h-full w-[40px] border-r border-base'
167-
: 'flex-row w-full border-b border-base'
180+
switch (store.position) {
181+
case 'bottom':
182+
return 'flex-row w-full border-t border-base'
183+
case 'top':
184+
return 'flex-row w-full border-b border-base'
185+
case 'left':
186+
return 'flex-col h-full w-[40px] border-r border-base'
187+
case 'right':
188+
return 'flex-col h-full w-[40px] border-l border-base'
189+
default:
190+
return 'flex-row w-full border-t border-base'
191+
}
168192
})
169193
170194
const contentClass = computed(() => {
@@ -178,7 +202,7 @@ const contentClass = computed(() => {
178202
<div
179203
id="vite-devtools-edge-panel"
180204
class="bg-glass:75 border border-base color-base shadow overflow-hidden z-floating-anchor font-sans text-[15px] box-border"
181-
:class="`flex ${isVertical ? 'flex-row' : 'flex-col'}`"
205+
:class="panelLayoutClass"
182206
:style="panelStyle"
183207
>
184208
<DockPanelResizer v-if="hasPanelContent" :panel="context.panel" edge-mode />

0 commit comments

Comments
 (0)