|
| 1 | +import type { ThemeRegistrationAny } from "streamdown"; |
| 2 | + |
| 3 | +// Custom Shiki theme matching the Trigger.dev VS Code dark theme. |
| 4 | +// Colors taken directly from the VS Code extension's tokenColors. |
| 5 | +export const triggerDarkTheme: ThemeRegistrationAny = { |
| 6 | + name: "trigger-dark", |
| 7 | + type: "dark", |
| 8 | + colors: { |
| 9 | + "editor.background": "#212327", |
| 10 | + "editor.foreground": "#878C99", |
| 11 | + "editorLineNumber.foreground": "#484c54", |
| 12 | + }, |
| 13 | + tokenColors: [ |
| 14 | + // Control flow keywords: pink-purple |
| 15 | + { |
| 16 | + scope: [ |
| 17 | + "keyword.control", |
| 18 | + "keyword.operator.delete", |
| 19 | + "keyword.other.using", |
| 20 | + "keyword.other.operator", |
| 21 | + "entity.name.operator", |
| 22 | + ], |
| 23 | + settings: { foreground: "#E888F8" }, |
| 24 | + }, |
| 25 | + // Storage type (const, let, var, function, class): purple |
| 26 | + { |
| 27 | + scope: "storage.type", |
| 28 | + settings: { foreground: "#8271ED" }, |
| 29 | + }, |
| 30 | + // Storage modifiers (async, export, etc.): purple |
| 31 | + { |
| 32 | + scope: ["storage.modifier", "keyword.operator.noexcept"], |
| 33 | + settings: { foreground: "#8271ED" }, |
| 34 | + }, |
| 35 | + // Keyword operator expressions (new, typeof, instanceof, etc.): purple |
| 36 | + { |
| 37 | + scope: [ |
| 38 | + "keyword.operator.new", |
| 39 | + "keyword.operator.expression", |
| 40 | + "keyword.operator.cast", |
| 41 | + "keyword.operator.sizeof", |
| 42 | + "keyword.operator.instanceof", |
| 43 | + "keyword.operator.logical.python", |
| 44 | + "keyword.operator.wordlike", |
| 45 | + ], |
| 46 | + settings: { foreground: "#8271ED" }, |
| 47 | + }, |
| 48 | + // Types and namespaces: hot pink |
| 49 | + { |
| 50 | + scope: [ |
| 51 | + "support.class", |
| 52 | + "support.type", |
| 53 | + "entity.name.type", |
| 54 | + "entity.name.namespace", |
| 55 | + "entity.name.scope-resolution", |
| 56 | + "entity.name.class", |
| 57 | + "entity.other.inherited-class", |
| 58 | + ], |
| 59 | + settings: { foreground: "#F770C6" }, |
| 60 | + }, |
| 61 | + // Functions: lime/yellow-green |
| 62 | + { |
| 63 | + scope: ["entity.name.function", "support.function"], |
| 64 | + settings: { foreground: "#D9F07C" }, |
| 65 | + }, |
| 66 | + // Variables and parameters: light lavender |
| 67 | + { |
| 68 | + scope: [ |
| 69 | + "variable", |
| 70 | + "meta.definition.variable.name", |
| 71 | + "support.variable", |
| 72 | + "entity.name.variable", |
| 73 | + "constant.other.placeholder", |
| 74 | + ], |
| 75 | + settings: { foreground: "#CCCBFF" }, |
| 76 | + }, |
| 77 | + // Constants and enums: medium purple |
| 78 | + { |
| 79 | + scope: ["variable.other.constant", "variable.other.enummember"], |
| 80 | + settings: { foreground: "#9C9AF2" }, |
| 81 | + }, |
| 82 | + // this/self: purple-blue |
| 83 | + { |
| 84 | + scope: "variable.language", |
| 85 | + settings: { foreground: "#9B99FF" }, |
| 86 | + }, |
| 87 | + // Object literal keys: medium purple-blue |
| 88 | + { |
| 89 | + scope: "meta.object-literal.key", |
| 90 | + settings: { foreground: "#8B89FF" }, |
| 91 | + }, |
| 92 | + // Strings: sage green |
| 93 | + { |
| 94 | + scope: ["string", "meta.embedded.assembly"], |
| 95 | + settings: { foreground: "#AFEC73" }, |
| 96 | + }, |
| 97 | + // String interpolation punctuation: blue-purple |
| 98 | + { |
| 99 | + scope: [ |
| 100 | + "punctuation.definition.template-expression.begin", |
| 101 | + "punctuation.definition.template-expression.end", |
| 102 | + "punctuation.section.embedded", |
| 103 | + ], |
| 104 | + settings: { foreground: "#7A78EA" }, |
| 105 | + }, |
| 106 | + // Template expression reset |
| 107 | + { |
| 108 | + scope: "meta.template.expression", |
| 109 | + settings: { foreground: "#d4d4d4" }, |
| 110 | + }, |
| 111 | + // Operators: gray (same as foreground) |
| 112 | + { |
| 113 | + scope: "keyword.operator", |
| 114 | + settings: { foreground: "#878C99" }, |
| 115 | + }, |
| 116 | + // Comments: olive gray |
| 117 | + { |
| 118 | + scope: "comment", |
| 119 | + settings: { foreground: "#6f736d" }, |
| 120 | + }, |
| 121 | + // Language constants (true, false, null, undefined): purple-blue |
| 122 | + { |
| 123 | + scope: "constant.language", |
| 124 | + settings: { foreground: "#9B99FF" }, |
| 125 | + }, |
| 126 | + // Numeric constants: light green |
| 127 | + { |
| 128 | + scope: [ |
| 129 | + "constant.numeric", |
| 130 | + "keyword.operator.plus.exponent", |
| 131 | + "keyword.operator.minus.exponent", |
| 132 | + ], |
| 133 | + settings: { foreground: "#b5cea8" }, |
| 134 | + }, |
| 135 | + // Regex: dark red |
| 136 | + { |
| 137 | + scope: "constant.regexp", |
| 138 | + settings: { foreground: "#646695" }, |
| 139 | + }, |
| 140 | + // HTML/JSX tags: purple-blue |
| 141 | + { |
| 142 | + scope: "entity.name.tag", |
| 143 | + settings: { foreground: "#9B99FF" }, |
| 144 | + }, |
| 145 | + // Tag brackets: dark gray |
| 146 | + { |
| 147 | + scope: "punctuation.definition.tag", |
| 148 | + settings: { foreground: "#5F6570" }, |
| 149 | + }, |
| 150 | + // HTML/JSX attributes: light purple |
| 151 | + { |
| 152 | + scope: "entity.other.attribute-name", |
| 153 | + settings: { foreground: "#C39EFF" }, |
| 154 | + }, |
| 155 | + // Escape characters: gold |
| 156 | + { |
| 157 | + scope: "constant.character.escape", |
| 158 | + settings: { foreground: "#d7ba7d" }, |
| 159 | + }, |
| 160 | + // Regex string: dark red |
| 161 | + { |
| 162 | + scope: "string.regexp", |
| 163 | + settings: { foreground: "#d16969" }, |
| 164 | + }, |
| 165 | + // Storage: purple-blue |
| 166 | + { |
| 167 | + scope: "storage", |
| 168 | + settings: { foreground: "#9B99FF" }, |
| 169 | + }, |
| 170 | + // TS-specific: type casts, math/dom/json constants |
| 171 | + { |
| 172 | + scope: [ |
| 173 | + "meta.type.cast.expr", |
| 174 | + "meta.type.new.expr", |
| 175 | + "support.constant.math", |
| 176 | + "support.constant.dom", |
| 177 | + "support.constant.json", |
| 178 | + ], |
| 179 | + settings: { foreground: "#9B99FF" }, |
| 180 | + }, |
| 181 | + // Markdown headings: purple-blue bold |
| 182 | + { |
| 183 | + scope: "markup.heading", |
| 184 | + settings: { foreground: "#9B99FF", fontStyle: "bold" }, |
| 185 | + }, |
| 186 | + // Markup bold: purple-blue |
| 187 | + { |
| 188 | + scope: "markup.bold", |
| 189 | + settings: { foreground: "#9B99FF", fontStyle: "bold" }, |
| 190 | + }, |
| 191 | + // Markup inline raw: sage green |
| 192 | + { |
| 193 | + scope: "markup.inline.raw", |
| 194 | + settings: { foreground: "#AFEC73" }, |
| 195 | + }, |
| 196 | + // Markup inserted: light green |
| 197 | + { |
| 198 | + scope: "markup.inserted", |
| 199 | + settings: { foreground: "#b5cea8" }, |
| 200 | + }, |
| 201 | + // Markup deleted: sage green |
| 202 | + { |
| 203 | + scope: "markup.deleted", |
| 204 | + settings: { foreground: "#AFEC73" }, |
| 205 | + }, |
| 206 | + // Markup changed: purple-blue |
| 207 | + { |
| 208 | + scope: "markup.changed", |
| 209 | + settings: { foreground: "#9B99FF" }, |
| 210 | + }, |
| 211 | + // Invalid: red |
| 212 | + { |
| 213 | + scope: "invalid", |
| 214 | + settings: { foreground: "#f44747" }, |
| 215 | + }, |
| 216 | + // JSX text content |
| 217 | + { |
| 218 | + scope: ["meta.jsx.children"], |
| 219 | + settings: { foreground: "#D7D9DD" }, |
| 220 | + }, |
| 221 | + ], |
| 222 | +}; |
0 commit comments