Skip to content

Commit 19ee4f8

Browse files
update code box theme and highlighting (#617)
* style: update theme references from tokyo-night to vitesse-dark * style: update theme references from tokyo-night to vitesse-dark * ci: apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
1 parent 677888d commit 19ee4f8

File tree

2 files changed

+26
-12
lines changed

2 files changed

+26
-12
lines changed

src/components/Markdown.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ export function CodeBlock({
176176
<pre ref={ref} className={`shiki github-light h-full`}>
177177
<code>{lang === 'mermaid' ? <svg /> : code}</code>
178178
</pre>
179-
<pre className={`shiki tokyo-night`}>
179+
<pre className={`shiki vitesse-dark`}>
180180
<code>{lang === 'mermaid' ? <svg /> : code}</code>
181181
</pre>
182182
</>,
@@ -186,7 +186,7 @@ export function CodeBlock({
186186
typeof document !== 'undefined' ? 'useLayoutEffect' : 'useEffect'
187187
](() => {
188188
;(async () => {
189-
const themes = ['github-light', 'tokyo-night']
189+
const themes = ['github-light', 'vitesse-dark']
190190
const normalizedLang = LANG_ALIASES[lang] || lang
191191
const effectiveLang =
192192
normalizedLang === 'mermaid' ? 'plaintext' : normalizedLang
@@ -302,7 +302,7 @@ let highlighterPromise: Promise<HighlighterGeneric<any, any>> | null = null
302302
async function getHighlighter(language: string) {
303303
if (!highlighterPromise) {
304304
highlighterPromise = createHighlighter({
305-
themes: ['github-light', 'tokyo-night'],
305+
themes: ['github-light', 'vitesse-dark'],
306306
langs: [
307307
'typescript',
308308
'javascript',

src/styles/app.css

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ pre {
343343
pre.shiki {
344344
overflow-x: auto;
345345

346-
&.tokyo-night {
346+
&.vitesse-dark {
347347
@apply text-gray-400;
348348
}
349349
}
@@ -371,12 +371,26 @@ pre.shiki .language-id {
371371
display: none;
372372
}
373373

374+
span.line {
375+
display: inline-block;
376+
width: 100%;
377+
}
378+
379+
pre.has-diff span.diff {
380+
width: calc(100% + 20px);
381+
margin-left: -10px;
382+
padding-right: 20px;
383+
padding-left: 10px;
384+
padding-top: 4px;
385+
padding-bottom: 4px;
386+
}
387+
374388
pre.has-diff span.remove {
375-
background-color: #ff000036;
389+
background-color: #f43f5e29;
376390
}
377391

378392
pre.has-diff span.add {
379-
background-color: #00ff0036;
393+
background-color: #10b98129;
380394
}
381395
/* Visually differentiates twoslash code samples */
382396
pre.twoslash {
@@ -650,7 +664,7 @@ pre .logger.log-log svg {
650664
margin-right: 9px;
651665
}
652666

653-
html:not(.dark) .shiki.tokyo-night {
667+
html:not(.dark) .shiki.vitesse-dark {
654668
display: none;
655669
}
656670

@@ -659,11 +673,11 @@ html.dark .shiki.github-light {
659673
}
660674

661675
/* Improve comment contrast in dark mode */
662-
html.dark .shiki.tokyo-night .token.comment,
663-
html.dark .shiki.tokyo-night span[style*='color:#565F89'],
664-
html.dark .shiki.tokyo-night span[style*='color: #565F89'],
665-
html.dark .shiki.tokyo-night span[style*='color:#51597D'],
666-
html.dark .shiki.tokyo-night span[style*='color: #51597D'] {
676+
html.dark .shiki.vitesse-dark .token.comment,
677+
html.dark .shiki.vitesse-dark span[style*='color:#565F89'],
678+
html.dark .shiki.vitesse-dark span[style*='color: #565F89'],
679+
html.dark .shiki.vitesse-dark span[style*='color:#51597D'],
680+
html.dark .shiki.vitesse-dark span[style*='color: #51597D'] {
667681
color: #9099c0 !important;
668682
}
669683

0 commit comments

Comments
 (0)