Styling
Change the theme, component defaults, or a single instance.
Theme tokens
Edit the shared stylesheet added during installation. Define light values in :root and dark values in .dark. Use OKLCH values for colors.
<script setup lang="ts">
import { ref } from 'vue'
import { Button } from '~/components/ui/button'
const saved = ref(false)
</script>
<template>
<Button @click="saved = true">Save project</Button>
<p v-if="saved" role="status">Project saved.</p>
</template>
The Tailwind theme maps CSS tokens to utilities. For example, --background supplies bg-background, and --accent supplies bg-accent, text-accent, and border-accent.
| Token or utility | Use |
|---|---|
background, foreground | Page surface and body text. |
card, popover | Contained and floating surfaces with their foreground pairs. |
primary, secondary, accent | Action colors with matching foreground pairs. |
muted, muted-foreground | Neutral surfaces and supporting text. |
text-dimmed, text-toned, text-highlighted | Tertiary, secondary, and emphasized text. |
border, input, ring | Structural boundaries, field boundaries, and focus. |
info, success, warning, destructive | Feedback and status colors. |
--radius | Base radius from which component corners scale. |
Read Color for the full role descriptions.
Shared defaults
Use ui.config.ts for supported size, color, and variant defaults. This changes component props without editing recipes. See Usage for an example and the resolution order.
Instance styles
Use class to change the root element. Use ui to change named parts. Each component's API lists the available parts.
import tailwindcss from '@tailwindcss/vite'
export default defineNuxtConfig({
modules: ['akaza-ui/nuxt', '@nuxt/fonts', '@nuxtjs/color-mode'],
css: ['~/assets/main.css'],
colorMode: { classSuffix: '', preference: 'system', fallback: 'light' },
vite: { plugins: [tailwindcss()] },
})
The component merges your classes after its recipe with cn. Your overrides take priority.
Component recipes
Edit the Tailwind Variants recipe in the component's index.ts when an application needs a different treatment throughout. Keep styles in Tailwind utilities where possible.
The five sizes are xs, sm, md, lg, and xl. Change height, padding, text, radius, icon size, and gaps together. The geometry profiles describe these relationships.
Keep primary and accent solid actions tactile, secondary actions neutral, and state colors consistent. After changing a recipe, check both themes, hover, keyboard focus, disabled states, loading, and touch targets.