Customization
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, also used for error text | oklch(0.577 0.245 27.325) | oklch(0.704 0.191 22.216) |
--ecc-destructive-foreground | Text on destructive background | oklch(0.985 0 0) | oklch(0.205 0 0) |
--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 |
--ecc-surface-padding | Inset of components with the surface attribute | 1rem |
Typography Tokens
| Token | Description | Default |
|---|---|---|
--ecc-font-sans | Font family for all component text | Inherited from the page |
--ecc-font-mono | Font family for IDs, code and the code editor | ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace |
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);
}Typography
Components inherit the page's font unless you set the typography tokens:
:root {
--ecc-font-sans: "Inter", system-ui, sans-serif;
--ecc-font-mono: "JetBrains Mono", monospace;
}Dark Mode
Components switch to the dark defaults listed above when either:
- the component itself has a
darkattribute (<ecc-client-ga4gh-wes-runs dark>), or - an ancestor element has a
darkattribute or adarkclass (e.g.<html class="dark">).
Dark defaults are passed on to components nested inside other components, so
setting dark on the outermost component is enough.
Detection of a dark class or attribute on an ancestor relies on the CSS
:host-context() selector, which only Chromium-based browsers support (not
Firefox or Safari). For dark mode in all browsers, set the dark attribute
on the components themselves, or set the --ecc-* tokens for your dark theme
explicitly.
Any --ecc-* token you set takes precedence over the dark defaults.
Error messages use --ecc-destructive as their text color, so it should be
readable on --ecc-background. Earlier versions used a dark red default for
--ecc-destructive in dark mode; if you copied that value into your own
dark theme, use a lighter red such as oklch(0.704 0.191 22.216).
Surface Painting
By default, components are transparent: they show the page's background and
inherit its text color, which suits embedding them into an existing layout.
Add the surface attribute to have a component paint its own background and
text color from --ecc-background and --ecc-foreground. The surface is
inset by --ecc-surface-padding (default 1rem) and its corners are rounded
by --ecc-radius:
<ecc-client-ga4gh-wes-runs surface dark></ecc-client-ga4gh-wes-runs>This lets a component use a dark (or otherwise different) theme regardless of
the page it is placed on. Set surface on top-level, block-level components
only, such as the service components (ecc-client-*); components nested
inside them inherit the painted surface. Inline design components (e.g.
badges or buttons) are not laid out as a padded box.
Code Editor
The code editor used for parameters, logs and file contents follows the same
tokens: background and text use --ecc-background and --ecc-foreground, the
gutter uses --ecc-muted and --ecc-muted-foreground, keys and keywords use
--ecc-primary, strings are derived from --ecc-chart-2, numbers and other
constants from --ecc-chart-1, invalid code uses --ecc-destructive,
selections use --ecc-ring, and the font is --ecc-font-mono.
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.
