No dark theme for compilation in Twoslash
Author: htndevCreated Jun 19, 2026Updated Jun 19, 2026
Validations
- Follow our Code of Conduct
- Read the Contributing Guide.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Describe the bug
The default theme is unlikely to support a dark theme whatsoever: https://github.com/shikijs/shiki/blob/main/packages/twoslash/style-rich.css
Taken from the example:
My code:
I've imported style-rich.css, but it doesn't bring the dark colors either.
Reproduction
Code:
const generatedTypeCode = `// @filename: gen.ts
export type Types = "foo" | "bar"
// @filename: main.ts
// ---cut---
import { Types } from "./gen.ts";
// @noErrors
const bar: Types = ";
// ^|`;
const html = await codeToHtml(generatedTypeCode, {
lang: "ts",
transformers: [transformerTwoslash()],
colorsRendering: "css-vars",
defaultColor: "dark",
theme: "night-owl",
});Contributes
- I am willing to submit a PR to fix this issue
- I am willing to submit a PR with failing tests
Source: shikijs/shiki