Documentation
Customization

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

TokenDescriptionLight DefaultDark Default
--ecc-backgroundMain background coloroklch(1 0 0)oklch(0.145 0 0)
--ecc-foregroundMain text coloroklch(0.145 0 0)oklch(0.985 0 0)
--ecc-primaryPrimary brand coloroklch(0.205 0 0)oklch(0.985 0 0)
--ecc-primary-foregroundText on primary backgroundoklch(0.985 0 0)oklch(0.205 0 0)
--ecc-secondarySecondary coloroklch(0.97 0 0)oklch(0.269 0 0)
--ecc-secondary-foregroundText on secondary backgroundoklch(0.205 0 0)oklch(0.985 0 0)
--ecc-mutedMuted background coloroklch(0.97 0 0)oklch(0.269 0 0)
--ecc-muted-foregroundMuted text coloroklch(0.556 0 0)oklch(0.708 0 0)
--ecc-accentAccent coloroklch(0.97 0 0)oklch(0.269 0 0)
--ecc-accent-foregroundText on accent backgroundoklch(0.205 0 0)oklch(0.985 0 0)
--ecc-destructiveError/danger color, also used for error textoklch(0.577 0.245 27.325)oklch(0.704 0.191 22.216)
--ecc-destructive-foregroundText on destructive backgroundoklch(0.985 0 0)oklch(0.205 0 0)
--ecc-borderBorder coloroklch(0.922 0 0)oklch(0.269 0 0)
--ecc-inputInput border coloroklch(0.922 0 0)oklch(0.269 0 0)
--ecc-ringFocus ring coloroklch(0.708 0 0)oklch(0.439 0 0)

Card Tokens

TokenDescriptionLight DefaultDark Default
--ecc-cardCard backgroundoklch(1 0 0)oklch(0.145 0 0)
--ecc-card-foregroundCard text coloroklch(0.145 0 0)oklch(0.985 0 0)
--ecc-popoverPopover backgroundoklch(1 0 0)oklch(0.145 0 0)
--ecc-popover-foregroundPopover text coloroklch(0.145 0 0)oklch(0.985 0 0)

Chart Colors

TokenDescriptionLight DefaultDark Default
--ecc-chart-1Chart color 1oklch(0.646 0.222 41.116)oklch(0.488 0.243 264.376)
--ecc-chart-2Chart color 2oklch(0.6 0.118 184.704)oklch(0.696 0.17 162.48)
--ecc-chart-3Chart color 3oklch(0.398 0.07 227.392)oklch(0.769 0.188 70.08)
--ecc-chart-4Chart color 4oklch(0.828 0.189 84.429)oklch(0.627 0.265 303.9)
--ecc-chart-5Chart color 5oklch(0.769 0.188 70.08)oklch(0.645 0.246 16.439)

Layout Tokens

TokenDescriptionDefault
--ecc-radiusBorder radius0.625rem
--ecc-surface-paddingInset of components with the surface attribute1rem

Typography Tokens

TokenDescriptionDefault
--ecc-font-sansFont family for all component textInherited from the page
--ecc-font-monoFont family for IDs, code and the code editorui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace

Sidebar Tokens

TokenDescriptionLight DefaultDark Default
--ecc-sidebarSidebar backgroundoklch(0.985 0 0)oklch(0.205 0 0)
--ecc-sidebar-foregroundSidebar textoklch(0.145 0 0)oklch(0.985 0 0)
--ecc-sidebar-primarySidebar primaryoklch(0.205 0 0)oklch(0.488 0.243 264.376)
--ecc-sidebar-primary-foregroundSidebar primary textoklch(0.985 0 0)oklch(0.985 0 0)
--ecc-sidebar-accentSidebar accentoklch(0.97 0 0)oklch(0.269 0 0)
--ecc-sidebar-accent-foregroundSidebar accent textoklch(0.205 0 0)oklch(0.985 0 0)
--ecc-sidebar-borderSidebar borderoklch(0.922 0 0)oklch(0.269 0 0)
--ecc-sidebar-ringSidebar focus ringoklch(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 dark attribute (<ecc-client-ga4gh-wes-runs dark>), or
  • an ancestor element has a dark attribute or a dark class (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.

Released under Apache 2.0 License.

Copyright © 2023-2026 ELIXIR