docs(app): enable support for @nuxt/ui-pro with vue (#3191)

Co-authored-by: Benjamin Canac <canacb1@gmail.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Farnabaz <farnabaz@gmail.com>
This commit is contained in:
Hugo Richard
2025-02-26 19:00:45 +01:00
committed by GitHub
parent b53f77b304
commit 2cb4bd8a72
7 changed files with 176 additions and 17 deletions

View File

@@ -159,7 +159,9 @@ export default defineAppConfig({
::
#vue
::div
::module-only
#ui
:::div
You can configure these color aliases at runtime in your `vite.config.ts` file under the `ui.colors` key:
```ts [vite.config.ts]
@@ -181,6 +183,31 @@ export default defineConfig({
]
})
```
:::
#ui-pro
:::div
You can configure these color aliases at runtime in your `vite.config.ts` file under the `uiPro.colors` key:
```ts [vite.config.ts]
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import uiPro from '@nuxt/ui-pro/vite'
export default defineConfig({
plugins: [
vue(),
uiPro({
ui: {
colors: {
primary: 'blue',
neutral: 'zinc'
}
}
})
]
})
```
:::
::
@@ -229,6 +256,8 @@ export default defineNuxtConfig({
:::
#vue
::module-only
#ui
:::tip
You can add you own dynamic color aliases in your `vite.config.ts`, you just have to make sure to also define them in the [`theme.colors`](/getting-started/installation/vue#themecolors) option of the `ui` plugin.
@@ -255,6 +284,36 @@ export default defineConfig({
```
:::
#ui-pro
:::tip
You can add you own dynamic color aliases in your `vite.config.ts`, you just have to make sure to also define them in the [`theme.colors`](/getting-started/installation/vue#themecolors) option of the `uiPro` plugin.
```ts [vite.config.ts]
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import uiPro from '@nuxt/ui-pro/vite'
export default defineConfig({
plugins: [
vue(),
uiPro({
ui: {
colors: {
tertiary: 'indigo'
},
},
theme: {
colors: ['primary', 'secondary', 'tertiary', 'info', 'success', 'warning', 'error']
}
})
]
})
```
:::
::
::
### Tokens
@@ -788,7 +847,10 @@ export default defineAppConfig({
::
#vue
::div
::module-only
#ui
:::div
You can override the theme of components globally inside your `vite.config.ts` by using the exact same structure as the theme object.
Let's say you want to change the font weight of all your buttons, you can do it like this:
@@ -813,7 +875,35 @@ export default defineConfig({
]
})
```
:::
#ui-pro
:::div
You can override the theme of components globally inside your `vite.config.ts` by using the exact same structure as the theme object.
Let's say you want to change the font weight of all your buttons, you can do it like this:
```ts [vite.config.ts]
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import uiPro from '@nuxt/ui-pro/vite'
export default defineConfig({
plugins: [
vue(),
uiPro({
ui: {
button: {
slots: {
base: 'font-bold'
}
}
}
})
]
})
```
:::
::
::

View File

@@ -32,6 +32,9 @@ const mode = useColorMode()
You can disable this plugin with the `colorMode` option in your `vite.config.ts`:
::module-only
#ui
:::div
```ts [vite.config.ts]
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
@@ -46,3 +49,24 @@ export default defineConfig({
]
})
```
:::
#ui-pro
:::div
```ts [vite.config.ts]
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import uiPro from '@nuxt/ui-pro/vite'
export default defineConfig({
plugins: [
vue(),
uiPro({
colorMode: false
})
]
})
```
:::
::