fromCss

fun fromCss(cssText: String, name: String): HighlightTheme

Custom theme from raw Highlight.js CSS text.

Use this when you fetch or generate CSS at runtime rather than bundling it as an asset.

val css = // ... fetch from network or build programmatically
val theme = HighlightTheme.fromCss(
cssText = css,
name = "my-runtime-theme",
)

Return

A HighlightTheme whose color map is lazily parsed from cssText.

Parameters

cssText

Raw Highlight.js-compatible CSS text.

name

Display name for the theme.