From 23927198fbf789d1133b757571b202e24aa4e4ad Mon Sep 17 00:00:00 2001 From: "jlj05024111@163.com" Date: Fri, 21 Nov 2025 19:54:03 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0markdown=E5=85=A8?= =?UTF-8?q?=E5=B1=8F=E6=97=B6=E5=A7=8B=E7=BB=88=E6=89=93=E5=BC=80=E7=9B=AE?= =?UTF-8?q?=E5=BD=95=EF=BC=8C=E4=BC=98=E5=8C=96markdown=E5=86=85=E9=83=A8?= =?UTF-8?q?=E4=B8=BB=E9=A2=98=E5=8F=98=E6=9B=B4=E6=97=B6=E9=A1=B6=E9=83=A8?= =?UTF-8?q?=E5=B7=A5=E5=85=B7=E6=A0=8F=E7=9A=84=E6=A0=B7=E5=BC=8F=EF=BC=8C?= =?UTF-8?q?=E4=BB=A5=E5=8F=8A=E6=9A=97=E9=BB=91=E4=B8=BB=E9=A2=98=E4=B8=8B?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E5=99=A8=E8=BE=B9=E6=A1=86=E7=9A=84=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + .../ibiz-markdown-editor.scss | 64 ++++++++++++++++++- .../ibiz-markdown-editor.tsx | 6 +- 3 files changed, 68 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4c6896e59..f30aaa631 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ ### Changed +- 更新markdown全屏时始终打开目录,优化markdown内部主题变更时顶部工具栏的样式,以及暗黑主题下编辑器边框的样式 - 更新markdown行内AI聊天上下文菜单样式 - 优化markdown全屏时ESC关闭全屏逻辑,优化markdown插入文本逻辑 - 优化代码编辑器插入文本方法,将文本以段落的格式插入到光标位置 diff --git a/src/editor/markdown/ibiz-markdown-editor/ibiz-markdown-editor.scss b/src/editor/markdown/ibiz-markdown-editor/ibiz-markdown-editor.scss index 988245d36..2c23984d2 100644 --- a/src/editor/markdown/ibiz-markdown-editor/ibiz-markdown-editor.scss +++ b/src/editor/markdown/ibiz-markdown-editor/ibiz-markdown-editor.scss @@ -4,6 +4,12 @@ $markdown: ( color-manual-toolbar-text-save: getCssVar(color, primary-active-text), color-manual-toolbar-text-cancel: getCssVar(color,text,1), color-manual-toolbar-text-cancel-hover: getCssVar(color,primary), + color-dark-scrollbar-thumb-dark: #6d6d6d, + color-light-scrollbar-thumb-dark:#777, + color-scrollbar-thumb-dark-hover: #8e8e8e, + color-dark-toc-text: getCssVar(color, fill, 0), + color-toc-header-text: getCssVar(color, text, 0), + color-dark-mardown-border:#4f4f4f, spacing-manual-toolbar-height: 32px, spacing-manual-toolbar-gap: getCssVar('spacing',base), spacing-manual-toolbar-item-padding: 0 getCssVar('spacing',base), @@ -14,7 +20,6 @@ $markdown: ( height-manual-toolbar-height: getCssVar(height,control-default), border-radius-manual-toolbar-item: getCssVar('border-radius', small), border-manual-toolbar-fullscreen-footer: 1px solid getCssVar(color, border), - ); @@ -106,7 +111,6 @@ $markdown: ( box-shadow: none; .cherry-toolbar { - background-color: #{getCssVar(color, bg, 0)}; box-shadow: none; } @@ -184,4 +188,60 @@ $markdown: ( .cherry.fullscreen{ z-index: 999; } + + @include m('light'){ + .theme__light, + .theme__green, + .theme__violet{ + .cherry-toolbar{ + background-color: getCssVar(color, bg, 0); + } + } + + .theme__dark.cherry{ + .cherry-flex-toc{ + color: getCssVar(markdown,color-toc-header-text); + } + + & *::-webkit-scrollbar-thumb{ + background: getCssVar(markdown,color-light-scrollbar-thumb-dark); + + &:hover{ + background: getCssVar(markdown,color-scrollbar-thumb-dark-hover); + } + } + } + } + + @include m('dark'){ + &.#{bem(markdown-cherry)} { + .cherry { + border: 1px solid getCssVar(markdown, color-dark-mardown-border); + } + } + + + .theme__green, + .theme__violet, + .theme__light{ + .cherry-toolbar{ + background-color: getCssVar(color, shadow); + } + } + + .theme__light, + .theme__dark.cherry{ + .cherry-toc-head{ + color: getCssVar(markdown,color-dark-toc-text); + } + + & *::-webkit-scrollbar-thumb{ + background: getCssVar(markdown,color-dark-scrollbar-thumb-dark); + + &:hover{ + background: getCssVar(markdown,color-scrollbar-thumb-dark-hover); + } + } + } + } } \ No newline at end of file diff --git a/src/editor/markdown/ibiz-markdown-editor/ibiz-markdown-editor.tsx b/src/editor/markdown/ibiz-markdown-editor/ibiz-markdown-editor.tsx index 7b2b101d0..156b8466d 100644 --- a/src/editor/markdown/ibiz-markdown-editor/ibiz-markdown-editor.tsx +++ b/src/editor/markdown/ibiz-markdown-editor/ibiz-markdown-editor.tsx @@ -308,6 +308,7 @@ const IBizMarkDown: any = defineComponent({ isFullScreen.value = false; } else { openFullscreen(); + editor.toggleToc('full'); isFullScreen.value = true; } } @@ -694,7 +695,10 @@ const IBizMarkDown: any = defineComponent({ tabindex='-1' // 0 允许聚焦,-1 允许但不参数浏览器tab切换 id={this.id} style={this.cssVars} - class={this.ns.b('cherry')} + class={[ + this.ns.b('cherry'), + this.ns.m(this.theme === 'dark' ? 'dark' : 'light'), + ]} > ); -- Gitee