Skip to content

Commit 2b150c5

Browse files
fix(desktop): compact streamdown h1 rendering
Render top-level Streamdown headings as h3-sized text while keeping them above body copy.
1 parent 0354481 commit 2b150c5

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

apps/desktop/src/session/components/streamdown.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ const HEADING_WITH_MARGIN = "mt-4 first:mt-0";
66

77
export const streamdownComponents = {
88
h1: (props: React.HTMLAttributes<HTMLHeadingElement>) => (
9-
<h1 className={cn([HEADING_SHARED, HEADING_WITH_MARGIN, "text-xl"])}>
9+
<h3 className={cn([HEADING_SHARED, HEADING_WITH_MARGIN, "text-base"])}>
1010
{props.children as React.ReactNode}
11-
</h1>
11+
</h3>
1212
),
1313
h2: (props: React.HTMLAttributes<HTMLHeadingElement>) => (
1414
<h2 className={cn([HEADING_SHARED, HEADING_WITH_MARGIN, "text-lg"])}>

packages/tiptap/src/shared/streamdown-components.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ const HEADING_WITH_MARGIN = "mt-4 first:mt-0";
77

88
export const streamdownComponents = {
99
h1: (props: React.HTMLAttributes<HTMLHeadingElement>) => (
10-
<h1 className={cn([HEADING_SHARED, HEADING_WITH_MARGIN, "text-xl"])}>
10+
<h3 className={cn([HEADING_SHARED, HEADING_WITH_MARGIN, "text-base"])}>
1111
{props.children as React.ReactNode}
12-
</h1>
12+
</h3>
1313
),
1414
h2: (props: React.HTMLAttributes<HTMLHeadingElement>) => (
1515
<h2 className={cn([HEADING_SHARED, HEADING_WITH_MARGIN, "text-lg"])}>

0 commit comments

Comments
 (0)