@@ -6,7 +6,9 @@ import html from "shiki/langs/html.mjs";
66import json from "shiki/langs/json.mjs" ;
77import jsx from "shiki/langs/jsx.mjs" ;
88import markdown from "shiki/langs/markdown.mjs" ;
9+ import bash from "shiki/langs/bash.mjs" ;
910import tsx from "shiki/langs/tsx.mjs" ;
11+ import http from "shiki/langs/http.mjs" ;
1012import githubLight from "shiki/themes/github-light.mjs" ;
1113import vesper from "shiki/themes/vesper.mjs" ;
1214import { SciFiCard } from "@/components/scifi-card" ;
@@ -22,7 +24,7 @@ interface CodeBlockProps extends React.ComponentProps<"div"> {
2224
2325const highlighter = createHighlighterCoreSync ( {
2426 themes : [ vesper , githubLight ] ,
25- langs : [ tsx , jsx , html , css , json , markdown ] ,
27+ langs : [ tsx , jsx , html , css , json , markdown , bash , http ] ,
2628 engine : createJavaScriptRegexEngine ( ) ,
2729} ) ;
2830
@@ -69,12 +71,12 @@ function CodeBlock({
6971
7072 return (
7173 < SciFiCard
72- className = "group/code relative my-4 w-full overflow-hidden rounded border border-border bg-[#101010] text-sm backdrop-blur-sm transition-all duration-300 hover:border-primary/20"
74+ className = "group/code relative my-4 w-full overflow-hidden rounded border border-border bg-muted/50 dark:bg- [#101010] text-sm backdrop-blur-sm transition-all duration-300 hover:border-primary/20"
7375 cornerOpacity = "opacity-0 group-hover/code:opacity-100"
7476 variant = "primary"
7577 >
7678 { ( language !== "text" || filename ) && (
77- < div className = "flex items-center justify-between border-white /5 border-b bg-white /5 px-4 py-2.5" >
79+ < div className = "flex items-center justify-between border-foreground /5 border-b bg-foreground /5 px-4 py-2.5" >
7880 < div className = "flex items-center gap-3" >
7981 { filename && (
8082 < span className = "font-medium text-foreground/80 text-xs tracking-tight" >
@@ -104,9 +106,9 @@ function CodeBlock({
104106 { highlightedCode ? (
105107 < div
106108 className = { cn (
107- "overflow-x-auto font-mono text-[13px] leading-relaxed" ,
109+ "font-mono! text-[13px] leading-relaxed" ,
108110 "[&>pre]:m-0 [&>pre]:overflow-visible [&>pre]:p-4 [&>pre]:leading-relaxed" ,
109- "[&>pre>code]:block [&>pre>code]:w-full" ,
111+ "[&>pre>code]:overflow-x-auto [&>pre>code]: block [&>pre>code]:w-full [&>pre>code]:p-4 " ,
110112 "[&_.line]:min-h-5" ,
111113 className
112114 ) }
@@ -115,7 +117,7 @@ function CodeBlock({
115117 ) : (
116118 < pre
117119 className = { cn (
118- "overflow-x-auto p-4 font-mono text-foreground text-sm leading-relaxed" ,
120+ "overflow-x-auto p-4 font-mono! text-foreground text-sm leading-relaxed" ,
119121 "[&>code]:block [&>code]:w-full [&>code]:p-0 [&>code]:text-inherit" ,
120122 className
121123 ) }
@@ -133,7 +135,7 @@ function InlineCode({ className, ...props }: React.ComponentProps<"code">) {
133135 return (
134136 < code
135137 className = { cn (
136- "relative rounded border border-accent bg-accent/50 px-1.5 py-0.5 font-medium font-mono text-primary text-sm" ,
138+ "relative rounded border border-accent bg-accent/50 px-1.5 py-0.5 font-medium font-mono! text-primary text-sm" ,
137139 className
138140 ) }
139141 { ...props }
0 commit comments