Skip to content

Commit 70fdbee

Browse files
committed
feat(kit): adjust styling
1 parent f73b7d7 commit 70fdbee

File tree

5 files changed

+28
-13
lines changed

5 files changed

+28
-13
lines changed

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/DockIcon.vue

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { computed } from 'vue'
33
import VitePlusCore from './icons/VitePlusCore.vue'
44
55
const props = defineProps<{
6-
icon: string
6+
icon: string | { dark: string, light: string }
77
title?: string
88
}>()
99
@@ -19,9 +19,15 @@ function getIconUrl(str: string, color: 'dark' | 'light') {
1919
}
2020
2121
const icon = computed(() => {
22+
if (typeof props.icon === 'string') {
23+
return {
24+
dark: getIconUrl(props.icon, 'dark'),
25+
light: getIconUrl(props.icon, 'light'),
26+
}
27+
}
2228
return {
23-
dark: getIconUrl(props.icon, 'dark'),
24-
light: getIconUrl(props.icon, 'light'),
29+
dark: getIconUrl(props.icon.dark, 'dark'),
30+
light: getIconUrl(props.icon.light, 'light'),
2531
}
2632
})
2733
</script>

packages/core/src/client/webcomponents/style.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
#vite-devtools-anchor #vite-devtools-dock {
2121
--uno: h-full rounded-full select-none touch-none px4 ma h-[40px];
22-
--uno: shadow text-white bg-glass border border-base;
22+
--uno: shadow text-white bg-glass;
2323
--uno: transition-all duration-500;
2424
width: calc-size(max-content, size);
2525
}

packages/core/src/client/webcomponents/uno.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export default defineConfig({
2020
'z-floating-anchor': 'z-[2147483644]',
2121
'z-floating-tooltip': 'z-[2147483645]',
2222
},
23-
[/^bg-glass(:\d+)?$/, ([, opacity = ':75']) => `bg-white${opacity} dark:bg-#111${opacity} backdrop-blur-5`],
23+
[/^bg-glass(:\d+)?$/, ([, opacity = ':50']) => `bg-white${opacity} dark:bg-#111${opacity} backdrop-blur-5`],
2424
],
2525
transformers: [
2626
transformerDirectives(),

packages/kit/src/types/views.ts

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,24 @@ export interface DevToolsViewHost {
1818
hostStatic: (baseUrl: string, distDir: string) => void
1919
}
2020

21+
// TODO: refine categories more clearly
22+
export type DevToolsDockEntryCategory = 'app' | 'framework' | 'web' | 'advanced' | 'default'
23+
2124
export interface DevToolsDockEntryBase {
2225
id: string
2326
title: string
24-
icon: string
27+
icon: string | { light: string, dark: string }
28+
/**
29+
* The default order of the entry in the dock.
30+
* The higher the number the earlier it appears.
31+
* @default 0
32+
*/
33+
defaultOrder?: number
34+
/**
35+
* The category of the entry
36+
* @default 'default'
37+
*/
38+
category?: DevToolsDockEntryCategory
2539
}
2640

2741
export interface ClientScriptEntry {
@@ -52,11 +66,6 @@ export interface DevToolsViewIframe extends DevToolsDockEntryBase {
5266
import?: ClientScriptEntry
5367
}
5468

55-
export interface DevToolsViewWebComponent extends DevToolsDockEntryBase {
56-
type: 'webcomponent'
57-
import: ClientScriptEntry
58-
}
59-
6069
export interface DevToolsViewAction extends DevToolsDockEntryBase {
6170
type: 'action'
6271
import: ClientScriptEntry
@@ -67,4 +76,4 @@ export interface DevToolsViewCustomRender extends DevToolsDockEntryBase {
6776
import: ClientScriptEntry
6877
}
6978

70-
export type DevToolsDockEntry = DevToolsViewIframe | DevToolsViewWebComponent | DevToolsViewAction | DevToolsViewCustomRender
79+
export type DevToolsDockEntry = DevToolsViewIframe | DevToolsViewAction | DevToolsViewCustomRender

0 commit comments

Comments
 (0)