Skip to content

Commit a90bfcb

Browse files
committed
docs: added compiler/vuestic-config docs
1 parent 61c1ba5 commit a90bfcb

File tree

2 files changed

+70
-0
lines changed

2 files changed

+70
-0
lines changed
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
export default definePageConfig({
2+
blocks: [
3+
block.title('Vuestic Config'),
4+
5+
block.paragraph('Vuestic config is a file that allows you to configure Vuestic UI components. You can customize the theme, layout, and other settings.'),
6+
block.paragraph('Compiler can automatically add Vuestic config to your project, but you need to manually create file `vuestic.config.ts` in the root of your project. You can find the example of the config file below.'),
7+
8+
block.code({
9+
'vuestic.config.ts': `
10+
import { defineVuesticConfig } from 'vuestic-ui'
11+
12+
export default defineVuesticConfig({
13+
// Config here
14+
})
15+
`
16+
}),
17+
18+
block.alert('It is new recommended way to configure Vuestic UI components', 'info'),
19+
20+
block.subtitle('Installation'),
21+
22+
block.code({
23+
npm: 'npm install @vuestic/compiler@latest --save-dev',
24+
yarn: 'yarn add @vuestic/compiler@latest --dev'
25+
}, 'bash'),
26+
27+
block.paragraph('Add `@vuestic/compiler` to your `vite.config.js` or `vite.config.ts` file and set `cssLayers` option to `true`:'),
28+
29+
block.code({
30+
'vite.config.js': `
31+
import { defineConfig } from 'vite'
32+
import vue from '@vitejs/plugin-vue'
33+
import { vuestic } from '@vuestic/compiler/vite'
34+
35+
export default defineConfig({
36+
plugins: [
37+
vuestic({
38+
config: true,
39+
}),
40+
vue(),
41+
],
42+
})
43+
`,
44+
}),
45+
46+
block.subtitle('Typescript and IDE suggestions'),
47+
48+
block.paragraph('Vuestic compiler will generate typescript types, so you can get suggestions from your IDE for things like color names, i18n keys, icon names.'),
49+
50+
block.paragraph('Make sure to include generated types to your tsconfig.json:'),
51+
52+
block.code({
53+
'tsconfig.json': `
54+
{
55+
"include": ["node_modules/.vuestic/*.d.ts", "src/**/*"]
56+
}
57+
`
58+
}),
59+
60+
block.paragraph('In future versions, we can use the Vuestic config to generate code in compile time, that will reduce your bundle size and improve performance.'),
61+
]
62+
})

packages/docs/page-config/navigationRoutes.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -628,6 +628,14 @@ export const navigationRoutes: NavigationRoute[] = [
628628
badge: navigationBadge.new('1.10.0'),
629629
},
630630
path: '/compiler/css-layers',
631+
},
632+
{
633+
name: 'vuestic-config',
634+
displayName: 'Config',
635+
meta: {
636+
badge: navigationBadge.new('1.10.0'),
637+
},
638+
path: '/compiler/vuestic-config',
631639
}
632640
]
633641
},

0 commit comments

Comments
 (0)