Skip to content

Commit

Permalink
fix: fix markdown style missing bug
Browse files Browse the repository at this point in the history
  • Loading branch information
SchadenKai committed Sep 17, 2024
1 parent 353314b commit 95283dd
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 7 deletions.
11 changes: 6 additions & 5 deletions web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"yup": "^1.1.1"
},
"devDependencies": {
"@tailwindcss/typography": "^0.5.10",
"@tailwindcss/typography": "^0.5.15",
"eslint": "^8.48.0",
"eslint-config-next": "^14.1.0",
"prettier": "^3.3.3",
Expand Down
2 changes: 1 addition & 1 deletion web/src/app/chat/message/Messages.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ export const AIMessage = ({
{typeof content === "string" ? (
<ReactMarkdown
key={messageId}
className="max-w-full prose"
className="max-w-full prose markdown"
components={{
a: (props) => {
const { node, ...rest } = props;
Expand Down
44 changes: 44 additions & 0 deletions web/src/app/chat/message/custom-code-styles.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
.markdown > * {
all: revert;
}

.markdown {
table {
border-collapse: collapse;
}

tr {
border-top: 1px solid #c6cbd1;
background: #fff;
}

th,
td {
padding: 6px 13px;
border: 1px solid #dfe2e5;
}

table tr:nth-child(2n) {
background: #f6f8fa;
}
}

pre[class*="language-"] {
padding: 0px; /* Override padding */
margin: 0px;
Expand Down Expand Up @@ -31,6 +56,25 @@ pre[class*="language-"] {
box-shadow: 0 0 10px #6b7280; /* Light up effect on hover */
}

table {
margin: 16px 0px;
}

tr {
border-top: 1px solid #c6cbd1;
background: #fff;
}

th,
td {
padding: 6px 13px;
border: 1px solid #dfe2e5;
}

table tr:nth-child(2n) {
background: #f6f8fa;
}

scrollbar-width: thin;
scrollbar-color: #4b5563 #1f2937; /* thumb and track colors */
}

0 comments on commit 95283dd

Please sign in to comment.