|
| 1 | +import type { PrismTheme } from 'prism-react-renderer' |
| 2 | + |
| 3 | +/** |
| 4 | + * VS Code Dark+ / Light+ palettes mapped onto Prism token types, so docs |
| 5 | + * code blocks match the landing page figures (highlighted with shiki's |
| 6 | + * `dark-plus` / `light-plus` themes) and the hero demo video. |
| 7 | + * |
| 8 | + * Color sources: shiki's `dark-plus` / `light-plus` theme JSON. Prism |
| 9 | + * cannot tell control-flow keywords or object keys apart from regular |
| 10 | + * keywords and identifiers, so those keep the base keyword and variable |
| 11 | + * colors. |
| 12 | + * |
| 13 | + * Prism leaves TypeScript identifiers untokenized, so `plain` carries the |
| 14 | + * VS Code variable color in dark mode (#9cdcfe), matching how kysely |
| 15 | + * queries render in the editor. Punctuation and operators are tokenized |
| 16 | + * and pull those back to the editor foreground (#d4d4d4). |
| 17 | + */ |
| 18 | + |
| 19 | +export const darkPlus = { |
| 20 | + plain: { |
| 21 | + backgroundColor: '#1e1e1e', |
| 22 | + color: '#9cdcfe', |
| 23 | + }, |
| 24 | + styles: [ |
| 25 | + { |
| 26 | + style: { color: '#6a9955' }, |
| 27 | + types: ['comment', 'prolog', 'cdata'], |
| 28 | + }, |
| 29 | + { |
| 30 | + style: { color: '#569cd6' }, |
| 31 | + types: ['keyword', 'boolean', 'tag', 'changed'], |
| 32 | + }, |
| 33 | + { |
| 34 | + style: { color: '#ce9178' }, |
| 35 | + types: ['string', 'char', 'attr-value', 'template-string', 'deleted'], |
| 36 | + }, |
| 37 | + { |
| 38 | + style: { color: '#b5cea8' }, |
| 39 | + types: ['number', 'inserted'], |
| 40 | + }, |
| 41 | + { |
| 42 | + style: { color: '#dcdcaa' }, |
| 43 | + types: ['function'], |
| 44 | + }, |
| 45 | + { |
| 46 | + style: { color: '#4ec9b0' }, |
| 47 | + types: ['class-name', 'builtin', 'maybe-class-name', 'namespace'], |
| 48 | + }, |
| 49 | + { |
| 50 | + style: { color: '#4fc1ff' }, |
| 51 | + types: ['constant'], |
| 52 | + }, |
| 53 | + { |
| 54 | + style: { color: '#9cdcfe' }, |
| 55 | + types: ['variable', 'attr-name', 'property', 'literal-property'], |
| 56 | + }, |
| 57 | + { |
| 58 | + style: { color: '#d4d4d4' }, |
| 59 | + types: ['operator', 'punctuation'], |
| 60 | + }, |
| 61 | + { |
| 62 | + style: { color: '#d16969' }, |
| 63 | + types: ['regex'], |
| 64 | + }, |
| 65 | + { |
| 66 | + style: { color: '#d7ba7d' }, |
| 67 | + types: ['selector'], |
| 68 | + }, |
| 69 | + ], |
| 70 | +} satisfies PrismTheme |
| 71 | + |
| 72 | +export const lightPlus = { |
| 73 | + plain: { |
| 74 | + backgroundColor: '#ffffff', |
| 75 | + color: '#000000', |
| 76 | + }, |
| 77 | + styles: [ |
| 78 | + { |
| 79 | + style: { color: '#008000' }, |
| 80 | + types: ['comment', 'prolog', 'cdata'], |
| 81 | + }, |
| 82 | + { |
| 83 | + style: { color: '#0000ff' }, |
| 84 | + types: ['keyword', 'boolean'], |
| 85 | + }, |
| 86 | + { |
| 87 | + style: { color: '#a31515' }, |
| 88 | + types: ['string', 'char', 'attr-value', 'template-string', 'deleted'], |
| 89 | + }, |
| 90 | + { |
| 91 | + style: { color: '#098658' }, |
| 92 | + types: ['number', 'inserted'], |
| 93 | + }, |
| 94 | + { |
| 95 | + style: { color: '#795e26' }, |
| 96 | + types: ['function'], |
| 97 | + }, |
| 98 | + { |
| 99 | + style: { color: '#267f99' }, |
| 100 | + types: ['class-name', 'builtin', 'maybe-class-name', 'namespace'], |
| 101 | + }, |
| 102 | + { |
| 103 | + style: { color: '#0070c1' }, |
| 104 | + types: ['constant'], |
| 105 | + }, |
| 106 | + { |
| 107 | + style: { color: '#001080' }, |
| 108 | + types: ['variable', 'literal-property'], |
| 109 | + }, |
| 110 | + { |
| 111 | + style: { color: '#0451a5' }, |
| 112 | + types: ['property', 'changed'], |
| 113 | + }, |
| 114 | + { |
| 115 | + style: { color: '#e50000' }, |
| 116 | + types: ['attr-name'], |
| 117 | + }, |
| 118 | + { |
| 119 | + style: { color: '#800000' }, |
| 120 | + types: ['tag', 'selector'], |
| 121 | + }, |
| 122 | + { |
| 123 | + style: { color: '#000000' }, |
| 124 | + types: ['operator', 'punctuation'], |
| 125 | + }, |
| 126 | + { |
| 127 | + style: { color: '#811f3f' }, |
| 128 | + types: ['regex'], |
| 129 | + }, |
| 130 | + ], |
| 131 | +} satisfies PrismTheme |
0 commit comments