Skip to content

Commit 4503d39

Browse files
improve markdown rendering after bootstrap resets was removed (#1402)
Noticed styles of markdown looked much worse recently ## Before special note to large gap at the front and missing code formatting <img width="1782" height="1438" alt="Screenshot 2025-11-24 at 10 06 47 AM" src="https://github.com/user-attachments/assets/f5abbb61-1c99-424a-85d2-d1c12b489dbd" /> <img width="1910" height="1612" alt="Screenshot 2025-11-24 at 10 06 51 AM" src="https://github.com/user-attachments/assets/1eff6b65-b198-42c9-bc85-0068c6de7da5" /> ## After <img width="1350" height="1454" alt="Screenshot 2025-11-24 at 10 06 18 AM" src="https://github.com/user-attachments/assets/bba5f396-be1b-43c5-9d6f-bb4d264c11b9" /> <img width="1108" height="1568" alt="Screenshot 2025-11-24 at 10 06 29 AM" src="https://github.com/user-attachments/assets/73059e6e-c4fe-4872-953f-8f34c5ac40c9" />
1 parent e9033b4 commit 4503d39

File tree

3 files changed

+44
-1
lines changed

3 files changed

+44
-1
lines changed

.changeset/afraid-oranges-speak.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@hyperdx/app": patch
3+
---
4+
5+
improve markdown rendering after we removed bootrstrap reset styles

packages/app/src/HDXMarkdownChart.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const HDXMarkdownChart = memo(
1010
};
1111
}) => {
1212
return (
13-
<div className="HDXMarkdownChart">
13+
<div className="hdx-markdown">
1414
<ReactMarkdown>{markdown ?? ''}</ReactMarkdown>
1515
</div>
1616
);

packages/app/styles/app.scss

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,3 +304,41 @@ a,
304304
background: #50fa7a0d !important;
305305
color: #2E224788;
306306
}
307+
308+
.hdx-markdown {
309+
h1, h2, h3, h4, h5, h6, p {
310+
margin-top: 0;
311+
margin-bottom: 1rem;
312+
}
313+
ol, ul {
314+
padding-left: 2rem;
315+
}
316+
th {
317+
font-weight: 600;
318+
}
319+
h1 {
320+
font-size: 2rem;
321+
}
322+
h2 {
323+
font-size: 1.8rem;
324+
}
325+
h3 {
326+
font-size: 1.6rem;
327+
}
328+
h4 {
329+
font-size: 1.4rem;
330+
}
331+
// Remove margin on first and last child elements
332+
> :first-child {
333+
margin-top: 0;
334+
}
335+
> :last-child {
336+
margin-bottom: 0;
337+
}
338+
339+
code {
340+
font-size: 0.875em;
341+
color: var(--color-json-string);
342+
word-wrap: break-word;
343+
}
344+
}

0 commit comments

Comments
 (0)