Skip to content

Commit c9823ae

Browse files
authored
Merge pull request #51 from nesalia-inc/fix/shiki-theme-type-error
fix: use standard shiki theme to resolve type error
2 parents d90e6d8 + 501fee7 commit c9823ae

1 file changed

Lines changed: 12 additions & 51 deletions

File tree

apps/web/src/components/code-showcase.tsx

Lines changed: 12 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -104,46 +104,7 @@ export function CodeShowcase() {
104104
const highlight = async () => {
105105
const html = await codeToHtml(examples[current].code, {
106106
lang: "python",
107-
theme: {
108-
name: "github-dark-custom",
109-
type: "dark",
110-
foreground: "transparent",
111-
background: "transparent",
112-
settings: [
113-
{
114-
scope: "comment",
115-
settings: { foreground: "#8b949e", fontStyle: "italic" },
116-
},
117-
{
118-
scope: "keyword",
119-
settings: { foreground: "#ff7b72" },
120-
},
121-
{
122-
scope: "string",
123-
settings: { foreground: "#a5d6ff" },
124-
},
125-
{
126-
scope: "number",
127-
settings: { foreground: "#79c0ff" },
128-
},
129-
{
130-
scope: "type",
131-
settings: { foreground: "#ffa657" },
132-
},
133-
{
134-
scope: "function",
135-
settings: { foreground: "#d2a8ff" },
136-
},
137-
{
138-
scope: "variable",
139-
settings: { foreground: "#ffa657" },
140-
},
141-
{
142-
scope: "constant",
143-
settings: { foreground: "#79c0ff" },
144-
},
145-
],
146-
},
107+
theme: "github-dark",
147108
});
148109
setHighlightedCode(html);
149110
};
@@ -168,7 +129,7 @@ export function CodeShowcase() {
168129
{/* Code block */}
169130
<div className="flex-1 overflow-auto bg-background p-4 text-sm">
170131
<pre
171-
className="min-h-full bg-background [&>pre]:!bg-transparent"
132+
className="min-h-full bg-background [&_pre]:!bg-transparent"
172133
dangerouslySetInnerHTML={{ __html: highlightedCode }}
173134
/>
174135
</div>
@@ -201,16 +162,16 @@ export function CodeShowcase() {
201162
<Tooltip>
202163
<TooltipTrigger asChild>
203164
<Button
204-
variant="outline"
205-
size="icon"
206-
onClick={next}
207-
className="h-8 w-8 border-zinc-700 text-zinc-400 hover:bg-zinc-800 hover:text-zinc-200"
208-
>
209-
<ChevronRight className="h-4 w-4" />
210-
</Button>
211-
</TooltipTrigger>
212-
<TooltipContent side="top">Next example</TooltipContent>
213-
</Tooltip>
165+
variant="outline"
166+
size="icon"
167+
onClick={next}
168+
className="h-8 w-8 border-zinc-700 text-zinc-400 hover:bg-zinc-800 hover:text-zinc-200"
169+
>
170+
<ChevronRight className="h-4 w-4" />
171+
</Button>
172+
</TooltipTrigger>
173+
<TooltipContent side="top">Next example</TooltipContent>
174+
</Tooltip>
214175
</div>
215176
</div>
216177
</div>

0 commit comments

Comments
 (0)