From 82c5e5828c004935b2fa84a44d082ddb5d4d89a9 Mon Sep 17 00:00:00 2001 From: lidf Date: Sun, 12 Apr 2026 16:31:18 +0800 Subject: [PATCH] fix(ui): migrate markdown-body to global styles to bypass view encapsulation and fix list indents --- src/app/app.css | 47 +---------------------------------------------- src/styles.css | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 46 deletions(-) diff --git a/src/app/app.css b/src/app/app.css index 4acb525..cde2803 100644 --- a/src/app/app.css +++ b/src/app/app.css @@ -393,49 +393,4 @@ background: var(--color-primary); color: white; border: none; width: 36px; height: 36px; border-radius: 50%; display: flex; justify-content: center; align-items: center; transition: all 0.2s; } .chat-send-btn:disabled { background: #cbd5e1; color: #f1f5f9; } -/* Markdown in Chat */ -.markdown-body { - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; - line-height: 1.6; - font-size: 15px; - color: #1e293b; - letter-spacing: 0.01em; -} -.markdown-body p { - margin-bottom: 12px; -} -.markdown-body p:last-child { - margin-bottom: 0; -} -.markdown-body strong { - font-weight: 700; - color: #0f172a; -} -.markdown-body ul, .markdown-body ol { - padding-left: 24px !important; - margin-bottom: 12px; - margin-top: 4px; -} -.markdown-body ul { - list-style-type: disc !important; - list-style-position: outside !important; -} -.markdown-body ol { - list-style-type: decimal !important; - list-style-position: outside !important; -} -.markdown-body li { - margin-bottom: 6px; - display: list-item !important; - padding-left: 4px; -} -.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4 { - margin-top: 16px; - margin-bottom: 10px; - font-weight: 700; - line-height: 1.3; - color: #0f172a; -} -.markdown-body h3, .markdown-body h4 { - font-size: 16px; -} + diff --git a/src/styles.css b/src/styles.css index fbcecb7..261249f 100644 --- a/src/styles.css +++ b/src/styles.css @@ -200,3 +200,52 @@ button { .stagger-4 { animation-delay: 0.2s; } .stagger-5 { animation-delay: 0.25s; } .stagger-6 { animation-delay: 0.3s; } + +/* ======================================================================== + Markdown Rendering Styles (Global) + ======================================================================== */ +.markdown-body { + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; + line-height: 1.6; + font-size: 15px; + color: #1e293b; + letter-spacing: 0.01em; +} +.markdown-body p { + margin-bottom: 12px; +} +.markdown-body p:last-child { + margin-bottom: 0; +} +.markdown-body strong { + font-weight: 700; + color: #0f172a; +} +.markdown-body ul, .markdown-body ol { + padding-left: 28px !important; + margin-bottom: 12px; + margin-top: 4px; +} +.markdown-body ul { + list-style-type: disc !important; + list-style-position: outside !important; +} +.markdown-body ol { + list-style-type: decimal !important; + list-style-position: outside !important; +} +.markdown-body li { + margin-bottom: 6px; + display: list-item !important; + padding-left: 4px; +} +.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4 { + margin-top: 16px; + margin-bottom: 10px; + font-weight: 700; + line-height: 1.3; + color: #0f172a; +} +.markdown-body h3, .markdown-body h4 { + font-size: 16px; +}