theme.ts
29 documented symbols. Read the signatures first, then expand each item for parameters, return types, and 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
Parameters
-
targetT -
sourcePartial<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
fndefineTheme(config: ThemeConfig): ThemeConfigDefines a theme configuration with type checking.
Defines a theme configuration with type checking.
Signature
export function defineTheme(config: ThemeConfig): ThemeConfig
Parameters
-
configThemeConfig
Returns
Examples
const myTheme = defineTheme({
extends: defaultTheme,
colors: {
primary: '#3498db',
},
footer: {
copyright: '2025 My Company',
},
});
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
Parameters
-
themesThemeConfig[]
Returns
Examples
const merged = mergeThemes(defaultTheme, customTheme, overrides);
interfaceNapiThemeColorsNAPI-compatible theme colors type.
NAPI-compatible theme colors type.
Signature
export interface NapiThemeColors
Members
Properties
| Name | Type | Description |
|---|---|---|
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
Members
Properties
| Name | Type | Description |
|---|---|---|
colorsoptional |
NapiThemeColors |
|
cssoptional |
string |
|
darkColorsoptional |
NapiThemeColors |
|
embedoptional |
NapiThemeEmbed |
|
entryPageoptional |
NapiThemeEntryPage |
|
fontsoptional |
NapiThemeFonts |
|
footeroptional |
NapiThemeFooter |
|
headeroptional |
NapiThemeHeader |
|
jsoptional |
string |
|
layoutoptional |
NapiThemeLayout |
|
socialLinksoptional |
NapiSocialLinks |
interfaceNapiThemeEmbedNAPI-compatible theme embed type.
NAPI-compatible theme embed type.
Signature
export interface NapiThemeEmbed
Members
Properties
| Name | Type | Description |
|---|---|---|
contentAfteroptional |
string |
|
contentBeforeoptional |
string |
|
footeroptional |
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
Members
Properties
| Name | Type | Description |
|---|---|---|
modeoptional |
"default" | "subtle" |
interfaceNapiThemeFontsNAPI-compatible theme fonts type.
NAPI-compatible theme fonts type.
Signature
export interface NapiThemeFonts
Members
Properties
| Name | Type | Description |
|---|---|---|
monooptional |
string |
|
sansoptional |
string |
interfaceNapiThemeHeaderNAPI-compatible theme header type.
NAPI-compatible theme header type.
Signature
export interface NapiThemeHeader
Members
Properties
| Name | Type | Description |
|---|---|---|
logooptional |
string |
|
logoDarkoptional |
string |
|
logoHeightoptional |
number |
|
logoLightoptional |
string |
|
logoWidthoptional |
number |
|
showSiteNameTextoptional |
boolean |
interfaceNapiThemeLayoutNAPI-compatible theme layout type.
NAPI-compatible theme layout type.
Signature
export interface NapiThemeLayout
Members
Properties
| Name | Type | Description |
|---|---|---|
headerHeightoptional |
string |
|
maxContentWidthoptional |
string |
|
sidebarWidthoptional |
string |
interfaceResolvedThemeConfigResolved theme configuration (after merging with defaults).
Resolved theme configuration (after merging with defaults).
Signature
export interface ResolvedThemeConfig
Members
Properties
| Name | Type | Description |
|---|---|---|
colors |
ThemeColors |
|
css |
string |
|
darkColors |
ThemeColors |
|
embed |
ThemeEmbed |
|
entryPage |
ThemeEntryPage |
|
fonts |
ThemeFonts |
|
footer |
ThemeFooter |
|
header |
ThemeHeader |
|
js |
string |
|
layout |
ThemeLayout |
|
name |
string |
|
sidebar |
SidebarItem[] |
|
socialLinks |
SocialLinks |
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
Parameters
-
configThemeConfigoptional
Returns
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.
interfaceThemeColorsTheme color configuration.
Theme color configuration.
Signature
export interface ThemeColors
Members
Properties
| Name | Type | Description |
|---|---|---|
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
Members
Properties
| Name | Type | Description |
|---|---|---|
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) |
footeroptional |
ThemeFooter |
Footer configuration |
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[] |
|
socialLinksoptional |
SocialLinks |
Social links configuration |
interfaceThemeEmbedEmbedded HTML content for specific positions in the page layout.
Embedded HTML content for specific positions in the page layout.
Signature
export interface ThemeEmbed
Members
Properties
| Name | Type | Description |
|---|---|---|
contentAfteroptional |
string |
Content after main content |
contentBeforeoptional |
string |
Content before main content |
footeroptional |
string |
Custom footer content (replaces default footer) |
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
Members
Properties
| Name | Type | Description |
|---|---|---|
modeoptional |
"default" | "subtle" |
Landing page presentation mode |
interfaceThemeFontsTheme font configuration.
Theme font configuration.
Signature
export interface ThemeFonts
Members
Properties
| Name | Type | Description |
|---|---|---|
monooptional |
string |
Monospace font stack |
sansoptional |
string |
Sans-serif font stack |
interfaceThemeHeaderTheme header configuration.
Theme header configuration.
Signature
export interface ThemeHeader
Members
Properties
| Name | Type | Description |
|---|---|---|
logooptional |
string |
Logo image URL |
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
Members
Properties
| Name | Type | Description |
|---|---|---|
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
Parameters
-
themeResolvedThemeConfig
interface
SocialLinkCustom social link.3 membersCustom social link.
Signature
View source
Members
Properties
ariaLabeloptionalstringiconSocialLinkIconlinkstring