Ox Content

theme.ts

Source

ThemeColors

interface

Theme color configuration.

Source


ThemeLayout

interface

Theme layout configuration.

Source


ThemeFonts

interface

Theme font configuration.

Source


ThemeHeader

interface

Theme header configuration.

Source


ThemeFooter

interface

Theme footer configuration.

Source


SocialLinks

interface

Social links configuration.

Source


ThemeSlots

interface

Theme slots for injecting custom HTML.

Source


ThemeConfig

interface

Complete theme configuration.

Source


ResolvedThemeConfig

interface

Resolved theme configuration (after merging with defaults).

Source


deepMerge

function

Deep merge two objects.

Source

Returns

T -


defineTheme

function

Defines a theme configuration with type checking.

Source

export function defineTheme(config: ThemeConfig): ThemeConfig

Returns

ThemeConfig -

Examples

const myTheme = defineTheme({
  extends: defaultTheme,
  colors: {
    primary: '#3498db',
  },
  footer: {
    copyright: '2025 My Company',
  },
});

mergeThemes

function

Merges multiple theme configurations. Later themes override earlier ones.

Source

export function mergeThemes(...themes: ThemeConfig[]): ThemeConfig

Returns

ThemeConfig -

Examples

const merged = mergeThemes(defaultTheme, customTheme, overrides);

resolveTheme

function

Resolves a theme configuration by merging with its extends chain and defaults.

Source

export function resolveTheme(config?: ThemeConfig): ResolvedThemeConfig

Returns

ResolvedThemeConfig -


themeToNapi

function

Converts resolved theme to the format expected by Rust NAPI.

Source

export function themeToNapi(theme: ResolvedThemeConfig): NapiThemeConfig

Returns

NapiThemeConfig -


NapiThemeColors

interface

NAPI-compatible theme colors type.

Source


NapiThemeFonts

interface

NAPI-compatible theme fonts type.

Source


NapiThemeLayout

interface

NAPI-compatible theme layout type.

Source


NapiThemeHeader

interface

NAPI-compatible theme header type.

Source


NapiThemeFooter

interface

NAPI-compatible theme footer type.

Source


NapiSocialLinks

interface

NAPI-compatible social links type.

Source


NapiThemeSlots

interface

NAPI-compatible theme slots type.

Source


NapiThemeConfig

interface

NAPI-compatible theme configuration type.

Source