From dfc88e79d9049073157e7fcc74e0c331e0c09e1e Mon Sep 17 00:00:00 2001 From: sherifButt <90522472+sherifButt@users.noreply.github.com> Date: Fri, 23 Feb 2024 08:29:27 +0000 Subject: [PATCH 1/5] enhanced chat style and remove list restriction --- .../ChatHistory/HistoricalMessage/index.jsx | 2 +- .../ChatContainer/ChatHistory/index.jsx | 2 +- frontend/src/index.css | 149 ++++++++++++++++++ frontend/src/utils/chat/markdown.js | 2 +- 4 files changed, 152 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/WorkspaceChat/ChatContainer/ChatHistory/HistoricalMessage/index.jsx b/frontend/src/components/WorkspaceChat/ChatContainer/ChatHistory/HistoricalMessage/index.jsx index f4c5c86a712..1a3f1a0db5d 100644 --- a/frontend/src/components/WorkspaceChat/ChatContainer/ChatHistory/HistoricalMessage/index.jsx +++ b/frontend/src/components/WorkspaceChat/ChatContainer/ChatHistory/HistoricalMessage/index.jsx @@ -52,7 +52,7 @@ const HistoricalMessage = ({ ) : ( diff --git a/frontend/src/index.css b/frontend/src/index.css index 2c43798221b..876d8b90ece 100644 --- a/frontend/src/index.css +++ b/frontend/src/index.css @@ -443,3 +443,152 @@ dialog::backdrop { .input-label { @apply text-[14px] font-bold text-white; } + + +/** + * ============================================== + * Markdown Styles + * ============================================== + */ + + .markdown h1 { + font-size: xx-large; + line-height: 1.7; + padding-left: 0.3rem; +} +.markdown h2 { + line-height: 1.5; + font-size: x-large; + padding-left: 0.3rem; +} +.markdown h3 { + line-height: 1.4; + font-size: large; + padding-left: 0.3rem; +} + +/* Table Styles */ + +.markdown table { + border-collapse: separate; +} + +.markdown th { + border-top: none; +} + +.markdown td:first-child, +.markdown th:first-child { + border-left: none; +} + +.markdown table { + width: 100%; + border-collapse: collapse; + color: #bdbdbe; + font-size: 13px; + margin: 30px 0px; + border-radius: 10px; + overflow: hidden; + font-weight: normal; +} + +.markdown table thead { + color: #fff; + text-transform: uppercase; + font-weight: bolder; +} +.markdown hr { + border: 0; + border-top: 1px solid #cdcdcd40; + margin: 1rem 0; +} +.markdown table th, +.markdown table td { + padding: 8px 15px; + border-bottom: 1px solid #cdcdcd2e; + text-align: left; +} + +.markdown table th { + padding: 14px 15px; +} + +@media (max-width: 600px) { + table th, + table td { + padding: 10px; + } +} + +/* List Styles */ +ol { + list-style: decimal-leading-zero; + /* color: #dcdcdccf; */ + padding-left: 0px; + padding-top: 10px; + margin: 10px; +} + +ol li { + margin-left: 20px; + padding-left: 10px; + position: relative; + transition: all 0.3s ease; + line-height: 1.4rem; +} + +ol li::marker { + color: #d2d2d2cf; + padding-top: 10px; + font-weight: lighter; +} + +ol li p { + margin: 0.5rem; + padding-top: 10px; + color: #d9d9d9cf; +} + +ul { + list-style: revert-layer; + /* color: #cfcfcfcf; */ + padding-left: 0px; + padding-top: 10px; + padding-bottom: 10px; + margin: 10px; +} + +ul li::marker { + color: #d0d0d0cf; + padding-top: 10px; + font-weight: lighter; +} + +ul li { + margin-left: 20px; + + padding-left: 10px; + transition: all 0.3s ease; + line-height: 1.4rem; +} +ul li > ul { + padding-left: 20px; + margin: 0px; +} + +.markdown p { + margin: 0.35rem; +} + +.markdown { + text-wrap: wrap; +} +pre { + margin: 20px 0; +} + +strong { + font-weight: 600; + color: #fff; +} diff --git a/frontend/src/utils/chat/markdown.js b/frontend/src/utils/chat/markdown.js index 47b47734591..7d7faadb032 100644 --- a/frontend/src/utils/chat/markdown.js +++ b/frontend/src/utils/chat/markdown.js @@ -45,7 +45,7 @@ const markdown = markdownIt({ }, }) // Enable
    and