Theming
Customize your project with MicroClub's signature themes.
Overview
mcoli-ui ships with 5 signature themes designed to give your project a distinct visual identity. Each theme is crafted with MicroClub DNA, combining professional aesthetics with a bold, modern edge.
All themes support both light and dark modes out of the box.
Available Themes
| Theme | Value | Description | Light Primary | Dark Primary |
|---|---|---|---|---|
| Primary | primary | Clean, professional look with baby blue accents | #0006B1 | #D9DDFF |
| Secondary | secondary | Creative and bold with purple tones | #6A0DAD | #8B5CF6 |
| Game Dev | game-dev | Bold colors inspired by game development | #D04F99 | #FBE2A7 |
| Robotics | robotics | Technical feel with industrial blue tones | #001EFF | #2563EF |
| IT | it | Modern tech palette for software projects | #34D399 | #34D399 |
Add a Theme to Your Project
Deploy a theme directly to your project:
Interactive Mode
Running npx mcoli-ui@latest init without arguments launches an interactive theme selector.
Specify a Theme Directly
You can also specify a theme directly:
Available themes: primary, secondary, game-dev, robotics, it
Manual Setup
If you prefer manual control:
Select from the available themes:
primary- Professional and modernsecondary- Creative and boldgame-dev- Fun and energeticrobotics- Technical and preciseit- Clean and professional
Each theme exports light and dark color palettes. Theme files are located in:
src/registry/themes/{themeName}Theme.tsFor example, the Primary theme is at src/registry/themes/primaryTheme.ts.
Add the theme variables to your global CSS:
@theme {
--color-primary: oklch(70% 0.15 240);
--color-secondary: oklch(20% 0.15 240);
/* ... other theme colors */
}Theme Structure
Each theme follows this structure:
export const themeName = {
// Border radius values (vary by theme)
theme: {
'radius-sm': '0.125rem', // robotics uses tighter radii
'radius-md': '0.375rem',
'radius-lg': '0.5rem',
'radius-xl': '0.75rem',
'radius-2xl': '1rem', // game-dev uses 1rem
},
// Light mode colors
light: {
background: '...',
foreground: '...',
primary: '...',
'primary-foreground': '...',
// ... more colors
},
// Dark mode colors
dark: {
background: '...',
foreground: '...',
primary: '...',
'primary-foreground': '...',
// ... more colors
},
};Border radius values differ between themes. Robotics uses tighter radii (0.125rem), while Game Dev uses a larger radius-2xl (1rem).
Color System
All themes use a consistent color system. Here are all the available CSS variables you can use in your components. Each theme has its own values for light and dark modes.
| Token | Usage |
|---|---|
--background | Page background |
--foreground | Primary text |
--primary | Main brand color |
--primary-foreground | Text on primary |
--secondary | Secondary actions |
--secondary-foreground | Text on secondary |
--accent | Highlights |
--accent-foreground | Text on accent |
--card | Card background |
--card-foreground | Card text |
--popover | Popover background |
--popover-foreground | Popover text |
--muted | Muted backgrounds |
--muted-foreground | Muted text |
--destructive | Error states |
--destructive-foreground | Text on destructive |
--border | Borders |
--input | Input backgrounds |
--ring | Focus ring |
--surface | Surface backgrounds |
--surface-foreground | Surface text |
--success | Success states |
--success-foreground | Text on success |
--warning | Warning states |
--warning-foreground | Text on warning |
--error | Error states |
--info | Info states |
--info-foreground | Text on info |
Sidebar Variables
Sidebar-specific variables for navigation components:
| Token | Usage |
|---|---|
--sidebar | Sidebar background |
--sidebar-foreground | Sidebar text |
--sidebar-primary | Sidebar brand color |
--sidebar-primary-foreground | Text on sidebar primary |
--sidebar-accent | Sidebar accent |
--sidebar-accent-foreground | Text on sidebar accent |
--sidebar-border | Sidebar borders |
--sidebar-ring | Sidebar focus ring |
Chart Colors
Colors for data visualization:
| Token |
|---|
--chart-1 |
--chart-2 |
--chart-3 |
--chart-4 |
--chart-5 |
Using Colors in Components
In your Tailwind classes, use these tokens as follows:
className = 'text-muted-foreground'; // Uses --muted-foreground
className = 'bg-primary'; // Uses --primary
className = 'border-border'; // Uses --border
className = 'text-destructive'; // Uses --destructiveAll colors are available as bg-, text-, border-, and other Tailwind utilities.
Switching Themes
mcoli-ui components use CSS variables tied to theme tokens. To switch themes, re-run the init command with your desired theme:
This updates your registry configuration with the new theme's CSS variables.
Customizing Themes
For advanced customization, you can extend or override any theme:
@theme {
--color-primary: var(--primary);
--radius-lg: 1rem;
}
:root {
--primary: your-custom-color;
}
.dark {
--primary: your-custom-color;
}This gives you full control while maintaining consistency across your project.