Skip to content

Commit

Permalink
(EAI-532) [UI] Fix spacing for headings and lists (#529)
Browse files Browse the repository at this point in the history
  • Loading branch information
nlarew authored Oct 9, 2024
1 parent 4a54dae commit 3d64de2
Showing 1 changed file with 13 additions and 29 deletions.
42 changes: 13 additions & 29 deletions packages/mongodb-chatbot-ui/src/Message.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,42 +74,26 @@ const styles = {
display: flex;
flex-direction: column;
& * {
line-height: 28px;
}
& p {
font-weight: 400;
}
& a {
font-weight: 400;
}
& li {
white-space: normal;
margin-top: -1.5rem;
& li {
margin-top: 0;
margin-top: -1rem;
& ol li, & ul li {
margin-top: 0.5rem;
}
}
& code {
white-space: pre-wrap;
& ol, & ul {
overflow-wrap: anywhere;
}
`,
// End hacky fix
markdown_list: css`
overflow-wrap: anywhere;
margin-bottom: -1.5rem;
& ul {
margin-bottom: 0;
& h1, & h2, & h3 {
& +ol, & +ul {
margin-top: 0;
}
}
& ol {
margin-bottom: 0;
& p+h1, & p+h2, & p+h3 {
margin-top: 1rem;
}
`,
loading_skeleton: css`
Expand Down Expand Up @@ -153,14 +137,14 @@ const markdownProps = {
},
ol: ({ children, ordered, ...props }) => {
return (
<Body as="ol" className={styles.markdown_list} {...props}>
<Body as="ol" {...props}>
{children}
</Body>
);
},
ul: ({ children, ordered, ...props }) => {
return (
<Body className={styles.markdown_list} as="ul" {...props}>
<Body as="ul" {...props}>
{children}
</Body>
);
Expand Down

0 comments on commit 3d64de2

Please sign in to comment.