extras
Overrides for capture names not represented as typed fields. Wins over typed fields for the same name. Pass a stable map instance (e.g. an immutable mapOf(...) constructed once and reused) — mutating the map after handing it to SyntaxTheme breaks the Immutable contract and leads to stale recomposition.
Every bundled theme seeds this with markdown's text.* captures, so it is not empty on them. copy replaces the map wholesale — merge instead of overwriting, or markdown loses its styling:
val theme = SyntaxTheme.DarkDefault.let {
it.copy(extras = it.extras + mapOf("label" to SpanStyle(color = Color.Green)))
}Content copied to clipboard