-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstudio.config.js
36 lines (35 loc) · 1.18 KB
/
studio.config.js
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
28
29
30
31
32
33
34
35
36
export default {
components: './src/components.js',
componentManifest: {
path: './node_modules/@shoelace-style/shoelace/dist/custom-elements.json',
classNameFilter: '^Sl',
globalAttrs: false
},
customHints: './src/hints.js',
snippets: './src/snippets.js',
outputPath: './dist',
publicAssetsRoots: [
{
src: './node_modules/@shoelace-style/shoelace/dist/assets/icons/*',
dest: 'shoelace/assets/icons'
}
],
initialMode: 'dark',
darkModeCallback: (newMode) => {
document.documentElement.classList.remove(`sl-theme-dark`);
document.documentElement.classList.remove(`sl-theme-light`);
if(newMode !== 'system') {
document.documentElement.classList.add(`sl-theme-${newMode}`);
} else {
const darkMode = matchMedia('(prefers-color-scheme: dark)');
document.documentElement.classList.add(`sl-theme-${darkMode.matches ? 'dark' : 'light'}`);
}
},
port: 9000,
openBrowser: true,
paramType: 'search',
favicon: './src/images/favicon.svg',
widths: [320, 600, 960, 1028, 1200],
exampleCode: `<p>this is an example</p>`,
iframeSandbox: 'allow-scripts',
}