ant-design / pro-editor

🕹️ The Ultimate Editor UI Framework and Components
https://pro-editor.antdigital.dev
MIT License
220 stars 27 forks source link

markdown 组件的暗色主题怎么设置[Question] #159

Open jiehwa opened 9 months ago

jiehwa commented 9 months ago

🧐 问题描述 | Proposed Solution

如标题,使用了如下代码,设置 import { Markdown } from '@ant-design/pro-editor';

<ConfigProvider
        theme={{
          // 1. 单独使用暗色算法
          algorithm: theme.darkAlgorithm,
          // 2. 组合使用暗色算法与紧凑算法
          // algorithm: [theme.darkAlgorithm, theme.compactAlgorithm],
        }}
      >
        <p> 测试antd主题</p>
        <Title>h1. Ant Design</Title>
        <Button>antd主题按钮</Button>
        <Markdown>{`# This is an H1
        ## This is an H2
        ### This is an H3
        #### This is an H4
        ##### This is an H5`}
                </Markdown>
      </ConfigProvider>

antd的主题设置成了暗色背景,被 antd 组件包裹的 Button 和 Title 是变成了暗色的主题,但是 markdown 并没有变过来,markdown 如果想要也变成暗色,该如何设置?

📝 补充信息 | Additional Information

No response

ONLY-yours commented 9 months ago

https://ant-design.github.io/antd-style/zh-CN/guide/switch-theme

参考这个进行主题切换,文档我稍后会补充上来