Eunomia @eunomia/elements@eunomia/charts@eunomia/core
AllAngularReactNext.jsJavaScriptVue
EunomiaSalmonForestVioletOceanGoldFireCustom…
🇬🇧 English🇫🇷 Français

Foundations

The design tokens every component and theme is built from. Every token follows one of two naming conventions:

--eun-[content]-[variant]      /* e.g. --eun-space-m, --eun-font-size-s */
--eun-color-[group]-[shade]    /* e.g. --eun-color-primary-500 */

Nothing here is a fixed value baked into a component: every size, color, radius, and shadow is a CSS custom property, switchable at runtime (see Theming).

Every size token above (space, radius, border width, height, font size, ...) is expressed in rem, which is always relative to the font-size set on <html> rather than any nearby parent. Every measurement given in this documentation assumes the browser default: 1rem = 16px. An app that sets its own font-size on <html> (directly, or through a CSS reset using %) makes every Eunomia component inherit that scale instead: components render uniformly smaller or larger than what's documented here, not broken, just scaled.

Import

These tokens only exist once a theme stylesheet is loaded; without one, components fall back to the same default values documented here. Include one of the 7 prebuilt palettes and add its class to your app root:

<body class="eunomia-theme eunomia-violet-theme">
  <app-root></app-root>
</body>

How you get that stylesheet loaded depends on how your build handles CSS/Sass imports:

<link
  rel="stylesheet"
  href="node_modules/@eunomia/elements/styles/themes/prebuilt-themes/violet/eunomia-violet.theme.css"
/>

Works anywhere a plain <link> tag does: every theme ships compiled to .css next to its .scss, so no Sass step is needed.

For dark mode, use the eunomia-violet-theme--dark class instead (same import, just the class that follows it). Full detail (the 8 palettes, and generating a theme from your own two brand colors) is in Get started and Prebuilt themes.

Tokens

Space, radius, border, height, shadow, grid utilities

Typography

Font family, sizes, weights

Color

Grey scale, decorative, semantic states, neutral tokens

Tokens

Spacing, radius, border width, height, shadow, and grid layout utilities, identical across every brand and mode.

Space
Radius
Border width
Height
Shadow
Motion
Grid utilities

See Tokens overview for the full detail on every value.

Typography

Font family
Sizes
Weights

See Typography overview for live specimens of every step.

Color

Grey scale
Decorative
Semantic states
Neutral tokens

See Color overview for every swatch on one page, or Theming: Prebuilt themes for the brand-specific primary/secondary palettes.

JavaScript helpers

Next to the tokens, a few helpers register no component, so they run anywhere, a server included. Import them from @eunomia/elements, which installs @eunomia/core for you:

Module Exports See
@eunomia/elements/theme.js initializeTheme, buildPalette, buildTints, buildThemeCss Custom theme
@eunomia/elements/breakpoints.js EUNOMIA_BREAKPOINTS, mediaBelow, mediaFrom Breakpoints
@eunomia/elements/time.js debounce, throttle Rate limiting
@eunomia/elements/locale.js setDefaultLocale, getDefaultLocale below

setDefaultLocale(locale) sets the locale every component uses unless it has its own locale attribute, and getDefaultLocale() returns it ("en" until it's set). An unknown locale shows English strings, never an error.

@eunomia/core also exports date, time zone and motion functions, resolveLocale/resolveDictionary in locale.js, and parseBreakpointOrWidth, breakpointOrWidthConverter and breakpointWidth in breakpoints.js. They're shared between the Eunomia packages, not a public API: they can change in any version.

See also

  • Icons: the full eun-icon set, 1473 icons × 4 shapes, searchable and click-to-copy (its own page, not a foundation)