From 2ca30a14f6d88b1988fdab9b3b6fd326537ceb0b Mon Sep 17 00:00:00 2001 From: cyanray Date: Fri, 20 Dec 2024 22:58:36 +0800 Subject: [PATCH] feat: limit the maximum width of message content. --- src/renderer/src/assets/styles/markdown.scss | 1 + src/renderer/src/pages/home/Messages/Message.tsx | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/renderer/src/assets/styles/markdown.scss b/src/renderer/src/assets/styles/markdown.scss index 860b24620..7af93b80e 100644 --- a/src/renderer/src/assets/styles/markdown.scss +++ b/src/renderer/src/assets/styles/markdown.scss @@ -3,6 +3,7 @@ line-height: 1.6; user-select: text; word-break: break-word; + overflow-x: auto; h1:first-child, h2:first-child, diff --git a/src/renderer/src/pages/home/Messages/Message.tsx b/src/renderer/src/pages/home/Messages/Message.tsx index 9dc6018dc..a21d47064 100644 --- a/src/renderer/src/pages/home/Messages/Message.tsx +++ b/src/renderer/src/pages/home/Messages/Message.tsx @@ -192,6 +192,9 @@ const MessageContainer = styled.div` padding: 15px 20px 0 20px; position: relative; transition: background-color 0.3s ease; + max-width: 780px; + width: 100%; + margin: 0 auto; &.message-highlight { background-color: var(--color-primary-mute); }