#1290·shiki

No dark theme for compilation in Twoslash

Author: htndevCreated Jun 19, 2026Updated Jun 19, 2026

Validations

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: Image

My code: Image

I've imported style-rich.css, but it doesn't bring the dark colors either.

Reproduction

Code:

typescript
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