Skip to content

UI Library for Design Engineers. Animated components and effects you can copy and paste into your apps. Free. Open Source.

fix: code block styles

Dillion Verma9ec793fd8d96
diff --git a/apps/www/components/component-preview-tabs.tsx b/apps/www/components/component-preview-tabs.tsx
index 64a67d2b..01ff0e94 100644
--- a/apps/www/components/component-preview-tabs.tsx
+++ b/apps/www/components/component-preview-tabs.tsx
@@ -87,7 +87,7 @@ export function ComponentPreviewTabs({
<div
data-slot="code"
data-active={tab === "code"}
- className="absolute inset-0 hidden overflow-hidden data-[active=true]:block **:[figure]:!m-0 **:[pre]:h-[450px]"
+ className="absolute inset-0 hidden overflow-hidden rounded-md data-[active=true]:block **:[figure]:!m-0 **:[figure]:h-full **:[pre]:h-full **:[pre]:max-h-full"
>
{source}
</div>
diff --git a/apps/www/components/component-preview.tsx b/apps/www/components/component-preview.tsx
index c9479f6a..9ea9d933 100644
--- a/apps/www/components/component-preview.tsx
+++ b/apps/www/components/component-preview.tsx
@@ -13,10 +13,8 @@ interface ComponentPreviewProps extends React.HTMLAttributes<HTMLDivElement> {
export function ComponentPreview({
name,
- children,
className,
align = "center",
- preview = false,
hideCode = false,
...props
}: ComponentPreviewProps) {
diff --git a/apps/www/components/component-source.tsx b/apps/www/components/component-source.tsx
index 3aefe35f..bb9981cc 100644
--- a/apps/www/components/component-source.tsx
+++ b/apps/www/components/component-source.tsx
@@ -4,7 +4,6 @@ import * as React from "react"
import { highlightCode } from "@/lib/highlight-code"
import { getRegistryItem } from "@/lib/registry"
-import { cn } from "@/lib/utils"
import { CodeCollapsibleWrapper } from "@/components/code-collapsible-wrapper"
import { CopyButton } from "@/components/copy-button"
import { getIconForLanguageExtension } from "@/components/icons"
@@ -48,14 +47,12 @@ export async function ComponentSource({
if (!collapsible) {
return (
- <div className={cn("relative", className)}>
- <ComponentCode
- code={code}
- highlightedCode={highlightedCode}
- language={lang}
- title={title}
- />
- </div>
+ <ComponentCode
+ code={code}
+ highlightedCode={highlightedCode}
+ language={lang}
+ title={title}
+ />
)
}
@@ -83,7 +80,7 @@ function ComponentCode({
title: string | undefined
}) {
return (
- <figure data-rehype-pretty-code-figure="" className="[&>pre]:max-h-96">
+ <figure data-rehype-pretty-code-figure="" className="h-full">
{title && (
<figcaption
data-rehype-pretty-code-title=""
@@ -95,7 +92,10 @@ function ComponentCode({
</figcaption>
)}
<CopyButton value={code} />
- <div dangerouslySetInnerHTML={{ __html: highlightedCode }} />
+ <div
+ dangerouslySetInnerHTML={{ __html: highlightedCode }}
+ className="h-full"
+ />
</figure>
)
}