Skip to content

shiki-theme.ts#

View Markdown

Source

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

5 symbols 2 functions 3 variables 1 parameters 2 returns

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"

View source

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(): ThemeRegistration

View source

Returns

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 | ThemeRegistration

View source

Parameters

  • theme string | 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>

View source

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-"

View source

Last updated: