Skip to content

Theming, Design Tokens & i18n ​

1. Built-in & Custom Themes (themes + themeTokens) ​

Alongside built-in 'dark' and 'light' themes, register custom themes in themes inheriting from base: 'dark' | 'light'.

Token Cascade Priority ​

Tokens resolve from general to specific:

text
1. Built-in base palette ('dark' or 'light')
   ↓
2. themeTokens (shared brand defaults applied across every theme)
   ↓
3. themes[activeThemeId] (theme-specific tokens — highest priority)

Built-in dark / light Overrides

You can also pass dark and light keys inside themes to give each built-in theme its own brand accent or border color without inventing extra theme IDs.

tsx
import { RedDokia } from 'reddokia/react';

<RedDokia
  views={views}
  layout={layout}
  themeTokens={{ islandRadius: '10px' }}
  themes={{
    dark: { accent: '#818cf8' },
    light: { accent: '#4f46e5' },
    ocean: {
      base: 'dark',
      islandRadius: '16px', // overrides shared 10px when ocean is active
      shellBg: '#07131f',
      panelBg: '#0c1f33',
      contentsBg: '#0a1929',
      groupHeaderBg: '#102840',
      accent: '#38bdf8',
      border: '#1e3a5f',
    },
    warmPaper: {
      base: 'light',
      islandRadius: '6px',
      shellBg: '#f5efe6',
      panelBg: '#fbf8f3',
      contentsBg: '#fffdf9',
      groupHeaderBg: '#efe7da',
      accent: '#b45309',
      border: '#dfd3c3',
    },
  }}
/>
vue
<template>
  <RedDokia
    :views="views"
    :layout="layout"
    :theme-tokens="{ islandRadius: '10px' }"
    :themes="themes"
  />
</template>
svelte
<RedDokia
  views={views}
  layout={layout}
  themeTokens={{ islandRadius: '10px' }}
  {themes}
/>
ts
const dock = new RedDokia(container, {
  views,
  layout,
  themeTokens: { islandRadius: '10px' },
  themes: {
    ocean: { base: 'dark', accent: '#38bdf8', shellBg: '#07131f' },
  },
});

dock.setTheme('ocean'); // switches main window + all open OS pop-out windows

Core Design Tokens Reference ​

Token PropertyCSS VariablePurpose
shellBg--rd-shell-bgOuter workbench backdrop
topBarBg / edgeBarBg--rd-topbar-bg, --rd-edgebar-bgTopBar and EdgeBar rail surfaces
groupHeaderBg--rd-group-header-bgTab group header bar
contentsBg / panelBg--rd-contents-bg, --rd-panel-bgCentral contents & side panel surfaces
accent / accentSecondary--rd-accent, --rd-accent-secondaryPrimary & secondary highlight colors
border--rd-borderPanel & divider borders
textMain / textMuted--rd-text-main, --rd-text-mutedPrimary & muted foreground typography
islandRadius--rd-island-radiusCorner radius for island panel groups
fontSans / fontMono--rd-font-sans, --rd-font-monoUI and monospace font stacks

2. Localization (locale · localeStrings) ​

Built-in dictionaries cover 'en' (default), 'ko', and 'ja'; register any custom locale code (e.g., 'fr', 'zh-CN') via localeStrings with automatic 'en' fallback.

Flat vs. Per-Locale localeStrings ​

Pass either a flat partial object or a per-locale map ({ ko, en, ja, ... }) to localeStrings so controller.setLocale() switches custom strings automatically:

tsx
<RedDokia
  views={views}
  layout={layout}
  locale="ko"
  localeStrings={{
    ko: { closeTabTooltip: '탭 닫기 (Custom)' },
    en: { closeTabTooltip: 'Close Tab (Custom)' },
    ja: { closeTabTooltip: 'タブを閉じる (Custom)' },
    fr: { closeTab: 'Fermer', closeTabTooltip: 'Fermer l’onglet' },
    'zh-CN': { closeTab: '关闭', closeTabTooltip: '关闭标签页' },
  }}
/>

Reading the Active Locale Inside Panels

Call controller.getLocale() inside any panel to localize your own view copy in sync with RedDokia's built-in context menus and tooltips.