mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 12:14:41 +01:00
feat(module): add theme.defaultVariants option (#4400)
This commit is contained in:
@@ -225,6 +225,27 @@ export default defineNuxtConfig({
|
||||
This option adds the `transition-colors` class on components with hover or active states.
|
||||
::
|
||||
|
||||
### `theme.defaultVariants` :badge{label="Soon" class="align-text-top"}
|
||||
|
||||
Use the `theme.defaultVariants` option to override the default `color` and `size` variants for components.
|
||||
|
||||
- Default: `{ color: 'primary', size: 'md' }`{lang="ts-type"}
|
||||
|
||||
```ts [nuxt.config.ts]
|
||||
export default defineNuxtConfig({
|
||||
modules: ['@nuxt/ui'],
|
||||
css: ['~/assets/css/main.css'],
|
||||
ui: {
|
||||
theme: {
|
||||
defaultVariants: {
|
||||
color: 'neutral',
|
||||
size: 'sm'
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
## Continuous Releases
|
||||
|
||||
Nuxt UI uses [pkg.pr.new](https://github.com/stackblitz-labs/pkg.pr.new) for continuous preview releases, providing developers with instant access to the latest features and bug fixes without waiting for official releases.
|
||||
|
||||
@@ -333,6 +333,32 @@ export default defineConfig({
|
||||
This option adds the `transition-colors` class on components with hover or active states.
|
||||
::
|
||||
|
||||
### `theme.defaultVariants` :badge{label="Soon" class="align-text-top"}
|
||||
|
||||
Use the `theme.defaultVariants` option to override the default `color` and `size` variants for components.
|
||||
|
||||
- Default: `{ color: 'primary', size: 'md' }`{lang="ts-type"}
|
||||
|
||||
```ts [vite.config.ts]
|
||||
import { defineConfig } from 'vite'
|
||||
import vue from '@vitejs/plugin-vue'
|
||||
import ui from '@nuxt/ui/vite'
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [
|
||||
vue(),
|
||||
ui({
|
||||
theme: {
|
||||
defaultVariants: {
|
||||
color: 'neutral',
|
||||
size: 'sm'
|
||||
}
|
||||
}
|
||||
})
|
||||
]
|
||||
})
|
||||
```
|
||||
|
||||
### `inertia`
|
||||
|
||||
Use the `inertia` option to enable compatibility with [Inertia.js](https://inertiajs.com/).
|
||||
|
||||
Reference in New Issue
Block a user