-
-
Notifications
You must be signed in to change notification settings - Fork 79
Expand file tree
/
Copy pathDockStandalone.ts
More file actions
27 lines (24 loc) · 737 Bytes
/
DockStandalone.ts
File metadata and controls
27 lines (24 loc) · 737 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import type { DocksContext } from '@vitejs/devtools-kit/client'
import type { VueElementConstructor } from 'vue'
import { defineCustomElement } from 'vue'
import css from '../.generated/css'
import Component from './DockStandalone.vue'
const forcedColorModeCss = `
:host([data-vite-devtools-color-mode='dark']) {
color-scheme: dark;
}
:host([data-vite-devtools-color-mode='light']) {
color-scheme: light;
}
`
export const DockStandalone = defineCustomElement(
Component,
{
shadowRoot: true,
styles: [css, forcedColorModeCss],
},
) as VueElementConstructor<{
context: DocksContext
}>
if (!customElements.get('vite-devtools-dock-standalone'))
customElements.define('vite-devtools-dock-standalone', DockStandalone)