theme.ts

Source

29 documented symbols. Read the signatures first, then expand each item for parameters, return types, and examples.

29 symbols 5 functions 20 interfaces 2 types 1 variables 1 modules 6 parameters 114 members 5 returns 2 examples

Reference

fndeepMerge<T extends Record<string, unknown>>(target: T, source: Partial<T>): TDeep merge two objects.

Deep merge two objects.

Signature

function deepMerge<T extends Record<string, unknown>>(target: T, source: Partial<T>): T

View source

Parameters

  • target T
  • source Partial<T>

Returns

T
variableconst defaultTheme: ThemeConfigDefault theme configuration. Based on the current ox-content SSG styles.

Default theme configuration. Based on the current ox-content SSG styles.

Signature

export const defaultTheme: ThemeConfig

View source

fndefineTheme(config: ThemeConfig): ThemeConfigDefines a theme configuration with type checking.

Defines a theme configuration with type checking.

Signature

export function defineTheme(config: ThemeConfig): ThemeConfig

View source

Parameters

Returns

ThemeConfig

Examples

Example 1
const myTheme = defineTheme({
  extends: defaultTheme,
  colors: {
    primary: '#3498db',
  },
  footer: {
    copyright: '2025 My Company',
  },
});
interfaceLegacySocialLinksLegacy social links configuration.

Legacy social links configuration.

Signature

export interface LegacySocialLinks

View source

Members

Properties
NameTypeDescription
fnmergeThemes(...themes: ThemeConfig[]): ThemeConfigMerges multiple theme configurations. Later themes override earlier ones.

Merges multiple theme configurations. Later themes override earlier ones.

Signature

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

View source

Parameters

Returns

ThemeConfig

Examples

Example 1
const merged = mergeThemes(defaultTheme, customTheme, overrides);
interfaceNapiSocialLinksNAPI-compatible social links type.

NAPI-compatible social links type.

Signature

export interface NapiSocialLinks

View source

Members

Properties
NameTypeDescription
interfaceNapiThemeColorsNAPI-compatible theme colors type.

NAPI-compatible theme colors type.

Signature

export interface NapiThemeColors

View source

Members

Properties
NameTypeDescription
backgroundoptional string
backgroundAltoptional string
borderoptional string
codeBackgroundoptional string
codeBackgroundTopoptional string
codeTextoptional string
primaryoptional string
primaryHoveroptional string
textoptional string
textMutedoptional string
interfaceNapiThemeConfigNAPI-compatible theme configuration type.

NAPI-compatible theme configuration type.

Signature

export interface NapiThemeConfig

View source

Members

Properties
NameTypeDescription
colorsoptional NapiThemeColors
cssoptional string
darkColorsoptional NapiThemeColors
embedoptional NapiThemeEmbed
entryPageoptional NapiThemeEntryPage
fontsoptional NapiThemeFonts
headeroptional NapiThemeHeader
jsoptional string
layoutoptional NapiThemeLayout
interfaceNapiThemeEmbedNAPI-compatible theme embed type.

NAPI-compatible theme embed type.

Signature

export interface NapiThemeEmbed

View source

Members

Properties
NameTypeDescription
contentAfteroptional string
contentBeforeoptional string
footerBeforeoptional string
headoptional string
headerAfteroptional string
headerBeforeoptional string
sidebarAfteroptional string
sidebarBeforeoptional string
interfaceNapiThemeEntryPageNAPI-compatible entry page theme type.

NAPI-compatible entry page theme type.

Signature

export interface NapiThemeEntryPage

View source

Members

Properties
NameTypeDescription
modeoptional "default" | "subtle"
interfaceNapiThemeFontsNAPI-compatible theme fonts type.

NAPI-compatible theme fonts type.

Signature

export interface NapiThemeFonts

View source

Members

Properties
NameTypeDescription
monooptional string
sansoptional string
interfaceNapiThemeFooterNAPI-compatible theme footer type.

NAPI-compatible theme footer type.

Signature

export interface NapiThemeFooter

View source

Members

Properties
NameTypeDescription
messageoptional string
interfaceNapiThemeHeaderNAPI-compatible theme header type.

NAPI-compatible theme header type.

Signature

export interface NapiThemeHeader

View source

Members

Properties
NameTypeDescription
logoDarkoptional string
logoHeightoptional number
logoLightoptional string
logoWidthoptional number
showSiteNameTextoptional boolean
interfaceNapiThemeLayoutNAPI-compatible theme layout type.

NAPI-compatible theme layout type.

Signature

export interface NapiThemeLayout

View source

Members

Properties
NameTypeDescription
headerHeightoptional string
maxContentWidthoptional string
sidebarWidthoptional string
interfaceResolvedThemeConfigResolved theme configuration (after merging with defaults).

Resolved theme configuration (after merging with defaults).

Signature

export interface ResolvedThemeConfig

View source

Members

Properties
NameTypeDescription
colors ThemeColors
css string
darkColors ThemeColors
embed ThemeEmbed
entryPage ThemeEntryPage
fonts ThemeFonts
header ThemeHeader
js string
layout ThemeLayout
name string
sidebar SidebarItem[]
fnresolveTheme(config?: ThemeConfig): ResolvedThemeConfigResolves a theme configuration by merging with its extends chain and defaults.

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

Signature

export function resolveTheme(config?: ThemeConfig): ResolvedThemeConfig

View source

Parameters

Returns

ResolvedThemeConfig
interfaceSocialLinkCustom social link.

Custom social link.

Signature

export interface SocialLink

View source

Members

Properties
NameTypeDescription
typeSocialLinkIcon = string | { svg: string }Custom social link icon.

Custom social link icon.

Signature

export type SocialLinkIcon = string | { svg: string }

View source

typeSocialLinks = LegacySocialLinks | SocialLink[]Social links configuration.

Social links configuration.

Signature

export type SocialLinks = LegacySocialLinks | SocialLink[]

View source

modulethemeTheme API for ox-content SSG Provides VitePress-like theming with default theme + customization.

Theme API for ox-content SSG

Provides VitePress-like theming with default theme + customization.

View source

interfaceThemeColorsTheme color configuration.

Theme color configuration.

Signature

export interface ThemeColors

View source

Members

Properties
NameTypeDescription
backgroundoptional string
Background color
backgroundAltoptional string
Alternative background color (sidebar, code blocks)
borderoptional string
Border color
codeBackgroundoptional string
Code block background color
codeBackgroundTopoptional string
Code block gradient color at the top; defaults to codeBackground when customized
codeTextoptional string
Code block text color
primaryoptional string
Primary accent color
primaryHoveroptional string
Primary color on hover
textoptional string
Main text color
textMutedoptional string
Muted/secondary text color
interfaceThemeConfigComplete theme configuration.

Complete theme configuration.

Signature

export interface ThemeConfig

View source

Members

Properties
NameTypeDescription
colorsoptional ThemeColors
Light mode colors (maps to CSS variables)
cssoptional string
Additional custom CSS
darkColorsoptional ThemeColors
Dark mode colors (maps to CSS variables)
embedoptional ThemeEmbed
Embedded HTML content at specific positions
entryPageoptional ThemeEntryPage
Entry page configuration
extendsoptional ThemeConfig
Base theme to extend
fontsoptional ThemeFonts
Font configuration (maps to CSS variables)
headeroptional ThemeHeader
Header configuration
jsoptional string
Additional custom JavaScript
layoutoptional ThemeLayout
Layout configuration (maps to CSS variables)
nameoptional string
Theme name for identification
sidebaroptional SidebarItem[]
interfaceThemeEmbedEmbedded HTML content for specific positions in the page layout.

Embedded HTML content for specific positions in the page layout.

Signature

export interface ThemeEmbed

View source

Members

Properties
NameTypeDescription
contentAfteroptional string
Content after main content
contentBeforeoptional string
Content before main content
footerBeforeoptional string
Content before footer
headoptional string
Content to embed into <head>
headerAfteroptional string
Content after header
headerBeforeoptional string
Content before header
sidebarAfteroptional string
Content after sidebar navigation
sidebarBeforeoptional string
Content before sidebar navigation
interfaceThemeEntryPageEntry page theme configuration.

Entry page theme configuration.

Signature

export interface ThemeEntryPage

View source

Members

Properties
NameTypeDescription
modeoptional "default" | "subtle"
Landing page presentation mode
interfaceThemeFontsTheme font configuration.

Theme font configuration.

Signature

export interface ThemeFonts

View source

Members

Properties
NameTypeDescription
monooptional string
Monospace font stack
sansoptional string
Sans-serif font stack
interfaceThemeFooterTheme footer configuration.

Theme footer configuration.

Signature

export interface ThemeFooter

View source

Members

Properties
NameTypeDescription
messageoptional string
Footer message (supports HTML)
interfaceThemeHeaderTheme header configuration.

Theme header configuration.

Signature

export interface ThemeHeader

View source

Members

Properties
NameTypeDescription
logoDarkoptional string
Dark mode logo image URL
logoHeightoptional number
Logo height in pixels
logoLightoptional string
Light mode logo image URL
logoWidthoptional number
Logo width in pixels
showSiteNameTextoptional boolean
Whether to render the site name text next to the logo
interfaceThemeLayoutTheme layout configuration.

Theme layout configuration.

Signature

export interface ThemeLayout

View source

Members

Properties
NameTypeDescription
headerHeightoptional string
Header height (CSS value, e.g., "60px")
maxContentWidthoptional string
Maximum content width (CSS value, e.g., "960px")
sidebarWidthoptional string
Sidebar width (CSS value, e.g., "260px")
fnthemeToNapi(theme: ResolvedThemeConfig): NapiThemeConfigConverts resolved theme to the format expected by Rust NAPI.

Converts resolved theme to the format expected by Rust NAPI.

Signature

export function themeToNapi(theme: ResolvedThemeConfig): NapiThemeConfig

View source

Parameters

Returns

NapiThemeConfig