shiki-theme.ts#
5 documented symbols. Read the signatures first, then expand each item for parameters, return types, and examples.
Reference#
variableconst CSS_VARIABLES_THEME = "css-variables"Name callers pass as highlightTheme to render syntax colors as CSS custom prope…
Name callers pass as highlightTheme to render syntax colors as CSS custom properties instead of baked-in hex values.
Signature
export const CSS_VARIABLES_THEME = "css-variables"fncssVariablesTheme(): ThemeRegistrationShiki theme whose every color is a --octc-shiki-* custom property. This is what…
Shiki theme whose every color is a --octc-shiki-* custom property.
This is what lets syntax highlighting track the active color scheme in both light and dark from a single build: the HTML is generated once, and the properties resolve per mode. A fixed theme like github-dark cannot do that, and lands dark token colors on a light code block.
Signature
export function cssVariablesTheme(): ThemeRegistrationReturns
ThemeRegistration
fnresolveHighlightTheme(theme: string | ThemeRegistration): string | ThemeRegistrationResolves the css-variables alias; any other value passes through.
Resolves the css-variables alias; any other value passes through.
Signature
export function resolveHighlightTheme(theme: string | ThemeRegistration): string | ThemeRegistrationParameters
-
themestring | ThemeRegistration
Returns
string | ThemeRegistration
variableconst VARIABLE_DEFAULTS: Record<string, string>Fallbacks baked into each var() so a site with no color scheme installed still…
Fallbacks baked into each var() so a site with no color scheme installed still renders GitHub Dark colors — the previous default — rather than unstyled text. A @ox-content/theme-color-* package overrides them by defining the same properties per mode.
Signature
const VARIABLE_DEFAULTS: Record<string, string>variableconst VARIABLE_PREFIX = "--octc-shiki-"Prefix for the emitted properties, matching the rest of the design tokens.
Prefix for the emitted properties, matching the rest of the design tokens.
Signature
const VARIABLE_PREFIX = "--octc-shiki-"