Skip to content

Commit 19cc6b0

Browse files
committed
docs(highlight): fix pre background colors for dark mode
1 parent d59c1c6 commit 19cc6b0

File tree

2 files changed

+8
-15
lines changed

2 files changed

+8
-15
lines changed

apps/website/src/components/highlight/highlight.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export const Highlight = component$(
8484
);
8585

8686
return (
87-
<div class="code-example relative max-h-[31.25rem]">
87+
<div class="code-example relative max-h-[31.25rem] rounded-base">
8888
<CodeCopy
8989
class={[
9090
'absolute right-3 top-3 text-white hover:bg-slate-800 hover:text-white',
@@ -95,7 +95,7 @@ export const Highlight = component$(
9595
<div
9696
{...props}
9797
class={cn(
98-
'tab-size max-h-[31.25rem] max-w-full overflow-auto rounded-sm bg-gradient-to-b from-slate-900 to-slate-800 p-6 text-sm',
98+
'tab-size max-h-[31.25rem] max-w-full overflow-auto rounded-sm bg-gradient-to-b from-slate-900 to-slate-800 p-6 text-sm dark:from-background dark:to-accent/30',
9999
props.class,
100100
)}
101101
>

apps/website/src/components/mdx-components/index.tsx

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -91,25 +91,18 @@ export const components: Record<string, any> = {
9191
</li>
9292
);
9393
}),
94-
pre: component$<
95-
PropsOf<'div'> & {
96-
__rawString__?: string;
97-
}
98-
>(({ __rawString__, ...props }) => {
94+
pre: component$<{
95+
__rawString__?: string;
96+
}>(({ __rawString__ }) => {
9997
return (
100-
<div
101-
{...props}
102-
class={[
103-
cn('code-example relative mb-6 max-h-[31.25rem] rounded-base', props.class),
104-
]}
105-
>
98+
<div class="code-example relative mb-6 max-h-[31.25rem] rounded-base">
10699
<CodeCopy
107-
class="absolute right-3 top-3 text-white hover:bg-slate-800 hover:text-white"
100+
class="absolute right-3 top-3 text-white hover:text-white"
108101
code={__rawString__}
109102
/>
110103
<div
111104
class={cn(
112-
'max-h-[31.25rem] max-w-full overflow-auto rounded-base border bg-gradient-to-b p-6 text-sm',
105+
'max-h-[31.25rem] max-w-full overflow-y-auto rounded-base border bg-gradient-to-b from-slate-900 to-slate-800 p-6 text-sm dark:from-background dark:to-accent/30',
113106
)}
114107
>
115108
<pre>

0 commit comments

Comments
 (0)