Dual themes
Two themes in one render, switched by the reader's colour scheme rather than by JavaScript.
import { createHighlighter } from '@lumis-sh/lumis'
import { htmlMultiThemes } from '@lumis-sh/lumis/formatters'
import typescript from '@lumis-sh/wasm-typescript'
import latte from '@lumis-sh/themes/catppuccin_latte'
import frappe from '@lumis-sh/themes/catppuccin_frappe'
const hl = await createHighlighter({ languages: [typescript] })
const html = hl.highlight(source, htmlMultiThemes({
language: typescript,
themes: { light: latte, dark: frappe },
defaultTheme: 'light-dark()',
}))
Fetching parser…