vuejs / vitepress

Vite & Vue powered static site generator.
https://vitepress.dev
MIT License
13.21k stars 2.13k forks source link

配置 markdown.theme 主题未完全生效 #4333

Closed xiechen1201 closed 2 weeks ago

xiechen1201 commented 2 weeks ago

Describe the bug

当我配置了在 .vitepress/config.mjs 中配置markdown.theme: { light: 'night-owl', dark: 'night-owl' }后,当页面为白天模式的时候,代码块的样式并没有完全生效,背景颜色还是白色。

以下是我的配置:

// Markdown 配置
  markdown: {
    // 代码块主题
    theme: {
      light: 'night-owl',
      dark: 'night-owl'
    }
  }

以下是实际的效果: image

以下是我的版本:

{
  "devDependencies": {
      "vitepress": "^1.4.2"
   }
}

Reproduction

https://stackblitz.com/edit/vite-2suua2?file=docs%2F.vitepress%2Fconfig.ts

Expected behavior

希望无论是明亮模式还是黑暗模式都可以显示为 night-owl 的黑色主题

System Info

System:
    OS: macOS 14.1.2
    CPU: (8) arm64 Apple M1
    Memory: 91.70 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.18.0 - ~/.nvm/versions/node/v20.18.0/bin/node
    npm: 10.8.2 - ~/.nvm/versions/node/v20.18.0/bin/npm
  Browsers:
    Chrome: 130.0.6723.92
    Safari: 17.1.2
  npmPackages:
    vitepress: ^1.4.2 => 1.4.2

Additional context

No response

Validations

brc-dd commented 2 weeks ago

Duplicate of #3154

Copy those styles for now. It'll look like this:

image