feat(module): move colors options into theme.colors

This commit is contained in:
Benjamin Canac
2024-09-18 11:28:31 +02:00
parent d3317d828e
commit 2e954467c4
24 changed files with 95 additions and 92 deletions

View File

@@ -76,9 +76,24 @@ export default defineNuxtConfig({
})
```
### `colors`
### `fonts`
Use the `colors` option to choose which Tailwind CSS colors are used to generate classes for components.
Use the `fonts` option to enable or disable the `@nuxt/fonts` module.
- Default: `true`{lang="ts-type"}
```ts [nuxt.config.ts]
export default defineNuxtConfig({
modules: ['@nuxt/ui'],
ui: {
fonts: false
}
})
```
### `theme.colors`
Use the `theme.colors` option to choose which Tailwind CSS colors are used to generate classes for components.
- Default: `['red', 'orange', 'amber', 'yellow', 'lime', 'green', 'emerald', 'teal', 'cyan', 'sky', 'blue', 'indigo', 'violet', 'purple', 'fuchsia', 'pink', 'rose']`{lang="ts-type"}
@@ -95,21 +110,6 @@ export default defineNuxtConfig({
This can help reduce the number of CSS classes generated in your bundle.
::
### `fonts`
Use the `fonts` option to enable or disable the `@nuxt/fonts` module.
- Default: `true`{lang="ts-type"}
```ts [nuxt.config.ts]
export default defineNuxtConfig({
modules: ['@nuxt/ui'],
ui: {
fonts: false
}
})
```
### `theme.transitions`
Use the `theme.transitions` option to disable all transitions on components.

View File

@@ -15,7 +15,7 @@ slots:
---
::
You can change these colors with the [`colors`](/getting-started/installation#colors) option in your `nuxt.config.ts` to select only the colors you're actually using.
You can change these colors with the [`theme.colors`](/getting-started/installation#themecolors) option in your `nuxt.config.ts` to select only the colors you're actually using.
For example, if you added a custom `cerise` color and only use the default `blue` and `green` colors in your application, you can configure the `colors` option like this:
@@ -25,7 +25,9 @@ For example, if you added a custom `cerise` color and only use the default `blue
export default defineNuxtConfig({
modules: ['@nuxt/ui'],
ui: {
colors: ['cerise', 'blue', 'green']
theme: {
colors: ['cerise', 'blue', 'green']
}
}
})
```