theme.ts
24 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.
fndefineTheme(config: ThemeConfig): ThemeConfigDefines a theme configuration with type checking.
Defines a theme configuration with type checking.
Parameters
-
configThemeConfig
Returns
ThemeConfig
Examples
const myTheme = defineTheme({
extends: defaultTheme,
colors: {
primary: '#3498db',
},
footer: {
copyright: '2025 My Company',
},
});
fnmergeThemes(...themes): ThemeConfigMerges multiple theme configurations. Later themes override earlier ones.
Merges multiple theme configurations. Later themes override earlier ones.
Returns
ThemeConfig
Examples
const merged = mergeThemes(defaultTheme, customTheme, overrides);
interfaceNapiThemeColorsNAPI-compatible theme colors type.
NAPI-compatible theme colors type.
interfaceNapiThemeConfigNAPI-compatible theme configuration type.
NAPI-compatible theme configuration type.
interfaceNapiThemeEmbedNAPI-compatible theme embed type.
NAPI-compatible theme embed type.
interfaceNapiThemeEntryPageNAPI-compatible entry page theme type.
NAPI-compatible entry page theme type.
interfaceNapiThemeFontsNAPI-compatible theme fonts type.
NAPI-compatible theme fonts type.
interfaceNapiThemeHeaderNAPI-compatible theme header type.
NAPI-compatible theme header type.
interfaceNapiThemeLayoutNAPI-compatible theme layout type.
NAPI-compatible theme layout type.
interfaceResolvedThemeConfigResolved theme configuration (after merging with defaults).
Resolved theme configuration (after merging with defaults).
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.
Parameters
-
configThemeConfigoptional
Returns
ResolvedThemeConfig
interfaceThemeColorsTheme color configuration.
Theme color configuration.
interfaceThemeConfigComplete theme configuration.
Complete theme configuration.
interfaceThemeEmbedEmbedded HTML content for specific positions in the page layout.
Embedded HTML content for specific positions in the page layout.
interfaceThemeEntryPageEntry page theme configuration.
Entry page theme configuration.
interfaceThemeFontsTheme font configuration.
Theme font configuration.
interfaceThemeHeaderTheme header configuration.
Theme header configuration.
interfaceThemeLayoutTheme layout configuration.
Theme layout configuration.
fnthemeToNapi(theme: ResolvedThemeConfig): NapiThemeConfigConverts resolved theme to the format expected by Rust NAPI.
Converts resolved theme to the format expected by Rust NAPI.
Parameters
-
themeResolvedThemeConfig
Returns
NapiThemeConfig
interface
SocialLinksSocial links configuration.Social links configuration.
View source