Customization
ELIXIR Cloud Components (ECC) provides a flexible and powerful customization system that allows you to adapt components to match your design requirements. The system is built on CSS custom properties (tokens), inspired by the excellent design patterns from shadcn/ui (opens in a new tab).
This page focuses on the global design tokens that can be used with any ECC package, be it a service package (like WES, TRS, etc.) or the design utility package.
CSS Custom Properties (Design Tokens)
All ECC components use CSS custom properties with the --ecc-
prefix. You can override these in your application's CSS to customize the appearance of all components.
Available Tokens
Here are all the available design tokens you can customize:
Color Tokens
Token | Description | Light Default | Dark Default |
---|---|---|---|
--ecc-background | Main background color | oklch(1 0 0) | oklch(0.145 0 0) |
--ecc-foreground | Main text color | oklch(0.145 0 0) | oklch(0.985 0 0) |
--ecc-primary | Primary brand color | oklch(0.205 0 0) | oklch(0.985 0 0) |
--ecc-primary-foreground | Text on primary background | oklch(0.985 0 0) | oklch(0.205 0 0) |
--ecc-secondary | Secondary color | oklch(0.97 0 0) | oklch(0.269 0 0) |
--ecc-secondary-foreground | Text on secondary background | oklch(0.205 0 0) | oklch(0.985 0 0) |
--ecc-muted | Muted background color | oklch(0.97 0 0) | oklch(0.269 0 0) |
--ecc-muted-foreground | Muted text color | oklch(0.556 0 0) | oklch(0.708 0 0) |
--ecc-accent | Accent color | oklch(0.97 0 0) | oklch(0.269 0 0) |
--ecc-accent-foreground | Text on accent background | oklch(0.205 0 0) | oklch(0.985 0 0) |
--ecc-destructive | Error/danger color | oklch(0.577 0.245 27.325) | oklch(0.396 0.141 25.723) |
--ecc-destructive-foreground | Text on destructive background | oklch(0.985 0 0) | oklch(0.637 0.237 25.331) |
--ecc-border | Border color | oklch(0.922 0 0) | oklch(0.269 0 0) |
--ecc-input | Input border color | oklch(0.922 0 0) | oklch(0.269 0 0) |
--ecc-ring | Focus ring color | oklch(0.708 0 0) | oklch(0.439 0 0) |
Card Tokens
Token | Description | Light Default | Dark Default |
---|---|---|---|
--ecc-card | Card background | oklch(1 0 0) | oklch(0.145 0 0) |
--ecc-card-foreground | Card text color | oklch(0.145 0 0) | oklch(0.985 0 0) |
--ecc-popover | Popover background | oklch(1 0 0) | oklch(0.145 0 0) |
--ecc-popover-foreground | Popover text color | oklch(0.145 0 0) | oklch(0.985 0 0) |
Chart Colors
Token | Description | Light Default | Dark Default |
---|---|---|---|
--ecc-chart-1 | Chart color 1 | oklch(0.646 0.222 41.116) | oklch(0.488 0.243 264.376) |
--ecc-chart-2 | Chart color 2 | oklch(0.6 0.118 184.704) | oklch(0.696 0.17 162.48) |
--ecc-chart-3 | Chart color 3 | oklch(0.398 0.07 227.392) | oklch(0.769 0.188 70.08) |
--ecc-chart-4 | Chart color 4 | oklch(0.828 0.189 84.429) | oklch(0.627 0.265 303.9) |
--ecc-chart-5 | Chart color 5 | oklch(0.769 0.188 70.08) | oklch(0.645 0.246 16.439) |
Layout Tokens
Token | Description | Default |
---|---|---|
--ecc-radius | Border radius | 0.625rem |
Sidebar Tokens
Token | Description | Light Default | Dark Default |
---|---|---|---|
--ecc-sidebar | Sidebar background | oklch(0.985 0 0) | oklch(0.205 0 0) |
--ecc-sidebar-foreground | Sidebar text | oklch(0.145 0 0) | oklch(0.985 0 0) |
--ecc-sidebar-primary | Sidebar primary | oklch(0.205 0 0) | oklch(0.488 0.243 264.376) |
--ecc-sidebar-primary-foreground | Sidebar primary text | oklch(0.985 0 0) | oklch(0.985 0 0) |
--ecc-sidebar-accent | Sidebar accent | oklch(0.97 0 0) | oklch(0.269 0 0) |
--ecc-sidebar-accent-foreground | Sidebar accent text | oklch(0.205 0 0) | oklch(0.985 0 0) |
--ecc-sidebar-border | Sidebar border | oklch(0.922 0 0) | oklch(0.269 0 0) |
--ecc-sidebar-ring | Sidebar focus ring | oklch(0.708 0 0) | oklch(0.439 0 0) |
Customizing Design Tokens
To customize the appearance of ECC components, override the CSS custom properties in your application's CSS:
Basic Token Customization
:root {
/* Change the primary color to blue */
--ecc-primary: oklch(0.6 0.25 250);
--ecc-primary-foreground: oklch(1 0 0);
/* Customize border radius */
--ecc-radius: 1rem;
/* Update accent colors */
--ecc-accent: oklch(0.95 0.02 250);
--ecc-accent-foreground: oklch(0.2 0 250);
}
Theme-Specific Customization
You can also provide different values for dark mode:
:root {
/* Light theme */
--ecc-primary: oklch(0.4 0.25 250);
--ecc-background: oklch(1 0 0);
}
.dark {
/* Dark theme */
--ecc-primary: oklch(0.7 0.25 250);
--ecc-background: oklch(0.1 0 0);
}
Credits
This customization system is inspired by the excellent work of shadcn/ui (opens in a new tab), which pioneered many of the patterns we use for component architecture and theming. We've adapted their approach to work seamlessly with Web Components and the ECC ecosystem.