Overview
Fumadocs UI uses Tailwind CSS v4 with a comprehensive design token system for theming. All components are styled using CSS variables prefixed with--color-fd-*, making customization straightforward.
Setup
Installation
Fumadocs UI requires Tailwind CSS v4:Import Styles
app/layout.tsx
Color System
Design Tokens
Fumadocs uses semantic color tokens that automatically adapt to light and dark modes:CSS Variables
Tailwind Usage
Use thefd- prefix to access design tokens:
Built-in Themes
Fumadocs provides several pre-built color themes:Neutral
Default grayscale theme
Ocean
Blue ocean-inspired palette
Purple
Vibrant purple theme
Emerald
Fresh green theme
Ruby
Rich red theme
Catppuccin
Popular pastel theme
Solar
Solarized-inspired theme
Dusk
Soft purple-gray theme
Aspen
Nature-inspired theme
Using Built-in Themes
app/layout.tsx
Custom Themes
Create a Custom Theme
Override CSS variables in your global CSS file:app/globals.css
Component-Specific Theming
Target specific components with custom tokens:Dark Mode
Setup
Dark mode is enabled by default vianext-themes:
app/layout.tsx
Theme Toggle Options
Force Theme
Disable theme switching:Typography
Font Configuration
Configure fonts in your layout:app/layout.tsx
Tailwind Font Configuration
app/globals.css
Animations
Built-in Animations
Fumadocs includes several CSS animations:Custom Animations
Responsive Design
All components use Tailwind’s responsive utilities:CSS Variables Reference
Color Tokens
Layout Variables
Advanced Customization
Per-Component Theming
Gradient Backgrounds
Best Practices
- Always test your theme in both light and dark modes
- Use semantic tokens (
fd-primary,fd-muted) instead of direct colors - Maintain sufficient contrast ratios for accessibility (WCAG AA: 4.5:1)
- Use HSL color format for easier adjustments
- Test with real content to ensure readability
Examples
Brand Color Theme
app/globals.css