Skip to content

Commit fb5c19b

Browse files
committed
improvement(mothership): align markdown blockquote, img, em, del with design tokens
1 parent 9b333ea commit fb5c19b

4 files changed

Lines changed: 28 additions & 4 deletions

File tree

apps/sim/app/chat/components/message/components/markdown-renderer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ const COMPONENTS = {
115115
),
116116

117117
blockquote: ({ children }: React.HTMLAttributes<HTMLQuoteElement>) => (
118-
<blockquote className='my-4 border-gray-300 border-l-4 py-1 pl-4 font-sans text-gray-700 italic dark:border-gray-600 dark:text-gray-300'>
118+
<blockquote className='my-4 break-words border-[var(--divider)] border-l-2 pl-4 font-sans text-[var(--text-primary)] [&>p]:my-2 first:[&>p]:mt-0 last:[&>p]:mb-0'>
119119
{children}
120120
</blockquote>
121121
),

apps/sim/app/workspace/[workspaceId]/files/components/file-viewer/preview-panel.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ function CalloutBlock({ type, children }: { type: string; children?: React.React
263263
const config = CALLOUT_CONFIG[type]
264264
if (!config) {
265265
return (
266-
<blockquote className='my-4 break-words border-[var(--border-1)] border-l-4 py-1 pl-4 text-[var(--text-tertiary)] italic'>
266+
<blockquote className='my-4 break-words border-[var(--divider)] border-l-2 pl-4 text-[var(--text-primary)] [&>p]:my-2 first:[&>p]:mt-0 last:[&>p]:mb-0'>
267267
{children}
268268
</blockquote>
269269
)
@@ -605,7 +605,7 @@ const STATIC_MARKDOWN_COMPONENTS = {
605605
return <CalloutBlock type={calloutType}>{children}</CalloutBlock>
606606
}
607607
return (
608-
<blockquote className='my-4 break-words border-[var(--border-1)] border-l-4 py-1 pl-4 text-[var(--text-tertiary)] italic'>
608+
<blockquote className='my-4 break-words border-[var(--divider)] border-l-2 pl-4 text-[var(--text-primary)] [&>p]:my-2 first:[&>p]:mt-0 last:[&>p]:mb-0'>
609609
{children}
610610
</blockquote>
611611
)

apps/sim/app/workspace/[workspaceId]/home/components/message-content/components/chat-content/chat-content.tsx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,12 +222,36 @@ const MARKDOWN_COMPONENTS = {
222222
</code>
223223
)
224224
},
225+
blockquote({ children }: { children?: React.ReactNode }) {
226+
return (
227+
<blockquote className='my-4 break-words border-[var(--divider)] border-l-2 pl-4 text-[var(--text-primary)] [&>p]:my-2 first:[&>p]:mt-0 last:[&>p]:mb-0'>
228+
{children}
229+
</blockquote>
230+
)
231+
},
225232
input({ type, checked }: { type?: string; checked?: boolean }) {
226233
if (type === 'checkbox') {
227234
return <Checkbox checked={checked || false} disabled size='sm' className='mt-1.5 shrink-0' />
228235
}
229236
return <input type={type} checked={checked} readOnly />
230237
},
238+
em({ children }: { children?: React.ReactNode }) {
239+
return <em className='text-[var(--text-primary)] italic'>{children}</em>
240+
},
241+
del({ children }: { children?: React.ReactNode }) {
242+
return <del className='text-[var(--text-tertiary)] line-through'>{children}</del>
243+
},
244+
img({ src, alt }: { src?: string; alt?: string }) {
245+
if (!src) return null
246+
return (
247+
<img
248+
src={src}
249+
alt={alt ?? ''}
250+
loading='lazy'
251+
className='my-4 h-auto max-w-full rounded-lg border border-[var(--divider)]'
252+
/>
253+
)
254+
},
231255
}
232256

233257
interface ChatContentProps {

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/note-block/note-block.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ const NOTE_COMPONENTS = {
430430
<em className='break-words text-[var(--text-tertiary)]'>{children}</em>
431431
),
432432
blockquote: ({ children }: { children?: React.ReactNode }) => (
433-
<blockquote className='my-4 break-words border-[var(--border-1)] border-l-4 py-1 pl-4 text-[var(--text-tertiary)] italic'>
433+
<blockquote className='my-4 break-words border-[var(--divider)] border-l-2 pl-4 text-[var(--text-primary)] [&>p]:my-2 first:[&>p]:mt-0 last:[&>p]:mb-0'>
434434
{children}
435435
</blockquote>
436436
),

0 commit comments

Comments
 (0)