Theme

Udixio’s theme starts with one shared theme.config.ts file. React, Angular and Svelte use the same configuration contract: a source color is converted into color, typography and state tokens, then emitted as a stylesheet for Tailwind CSS.

Packages

The responsibilities are deliberately separated:

  • @udixio/tailwind exposes defineConfig and TailwindPlugin.
  • @udixio/theme contains the color engine, palettes, variants, loader and build integrations.
  • @udixio/ui-react, @udixio/ui-angular and @udixio/ui-svelte provide the framework components and runtime ThemeProvider adapters.

Install the shared theme packages in either application:

bash
npm install @udixio/theme @udixio/tailwind

Then install the component package for your framework:

bash
# React
npm install @udixio/ui-react

# Angular
npm install @udixio/ui-angular

# Svelte
npm install @udixio/ui-svelte

See Get started — React or Get started — Angular for build integration examples.

The shared theme.config.ts

Create this file at the root of the project. The content is the same for all three frameworks:

ts
// theme.config.ts
import { defineConfig } from '@udixio/tailwind';
import { Variants } from '@udixio/theme';

export default defineConfig({
  sourceColor: '#6750A4',
  variant: Variants.Udixio,
  contrastLevel: 0,

  darkMode: 'class',
  darkSelector: '.dark',

  palettes: {
    brand: '#FF5722',
  },

  colors: {
    highlight: '#FFB300',
  },

  fontFamily: {
    expressive: ['Playfair Display', 'Georgia', 'serif'],
    neutral: ['Inter', 'system-ui', 'sans-serif'],
  },
});

defineConfig combines the core theme options with the Tailwind and typography options. It also wires TailwindPlugin and FontPlugin, so an application normally does not instantiate those plugins itself.

Build output

The Node/CLI build writes udixio.generated.css by default. Configure the path when the stylesheet belongs in a specific source directory:

ts
// theme.config.ts
import { defineConfig } from '@udixio/tailwind';

export default defineConfig({
  sourceColor: '#6750A4',
  outFile: 'src/styles/udixio.generated.css',
});

Each framework consumes the same generated stylesheet:

FrameworkBuild integrationRuntime provider
ReactvitePlugin or another bundler pluginThemeProvider for live web changes
Angularudixio-theme CLI or a compatible build pluginThemeProvider for live web changes
SveltevitePlugin or another bundler pluginThemeProvider for live web changes

Dynamic themes on the web

For a static light/dark theme, the generated CSS is enough. On the web, a React, Angular or Svelte application can use ThemeProvider to regenerate the dynamic layer after the theme configuration changes at runtime. The provider is exported from the matching UI package and accepts the same configuration:

All three adapters use the same Web Worker implementation. If the browser cannot create a worker, generation falls back to the main thread.

ThemeProvider itself does not toggle the .dark selector — your application still controls that class or uses darkMode: 'media'. Angular uses <udx-theme-provider [config]="themeConfig">…</udx-theme-provider>; Svelte uses <ThemeProvider config={themeConfig}>…</ThemeProvider>. For server rendering, each UI package also exports generateThemeCss(config); pass its result to initialCss to render the stylesheet immediately.

Next steps

PageWhat you’ll learn
ConfigurationAll defineConfig options
Colors & SurfacesTailwind classes and semantic color tokens
Dark modeClass/media strategies and runtime web usage
Sub-themesMultiple color schemes on one page
Typographytext-display-lg, font family setup
VariantsChange the visual flavor
Custom palettesAdd brand colors