Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

代码块颜色如何修改? #34

Open
ImSwordTooth opened this issue May 25, 2021 · 7 comments
Open

代码块颜色如何修改? #34

ImSwordTooth opened this issue May 25, 2021 · 7 comments

Comments

@ImSwordTooth
Copy link

ImSwordTooth commented May 25, 2021

Describe the bug
为什么代码块默认是这种颜色呢?
image
palette.styl 没动过,想要 vuepress 官网的那种样式。不知道有没有开放配置?

System Info

  • VuePress version:1.8.2
  • Antdocs version:1.3.4
  • Node version:14.16.1
  • OS version:10.15.7
@zpfz
Copy link
Owner

zpfz commented May 25, 2021

为了尽量保持和 Ant Design 文档一样的风格,1.3.2 版本及以上更改了代码块主题为亮色,如果不喜欢默认代码块主题,可以在项目下 node_modules/prismjs/themes 下找到 prism-tomorrow.css 文件,然后复制到项目的 .vuepress/public 下,以 head 头部引入的方式进行覆盖即可。

@ImSwordTooth
Copy link
Author

为了尽量保持和 Ant Design 文档一样的风格,1.3.2 版本及以上更改了代码块主题为亮色,如果不喜欢默认代码块主题,可以在项目下 node_modules/prismjs/themes 下找到 prism-tomorrow.css 文件,然后复制到项目的 .vuepress/public 下,以 head 头部引入的方式进行覆盖即可。

image
是这样吗?
但是优先级没有主题提供的高,引用成功了,但是被主题样式覆盖了

@zpfz
Copy link
Owner

zpfz commented May 26, 2021

为了尽量保持和 Ant Design 文档一样的风格,1.3.2 版本及以上更改了代码块主题为亮色,如果不喜欢默认代码块主题,可以在项目下 node_modules/prismjs/themes 下找到 prism-tomorrow.css 文件,然后复制到项目的 .vuepress/public 下,以 head 头部引入的方式进行覆盖即可。

image
是这样吗?
但是优先级没有主题提供的高,引用成功了,但是被主题样式覆盖了

🤔那我再尝试有无更好的方案解决这个问题

@ImSwordTooth
Copy link
Author

为了尽量保持和 Ant Design 文档一样的风格,1.3.2 版本及以上更改了代码块主题为亮色,如果不喜欢默认代码块主题,可以在项目下 node_modules/prismjs/themes 下找到 prism-tomorrow.css 文件,然后复制到项目的 .vuepress/public 下,以 head 头部引入的方式进行覆盖即可。

image
是这样吗?
但是优先级没有主题提供的高,引用成功了,但是被主题样式覆盖了

🤔那我再尝试有无更好的方案解决这个问题

好的,感谢

@zpfz
Copy link
Owner

zpfz commented May 27, 2021

晚上我测试了下,目前只能暂时用 css 进行覆盖。

@ImSwordTooth
Copy link
Author

晚上我测试了下,目前只能暂时用 css 进行覆盖。

好的,那我也先手动了。
后面可以考虑暴露个配置❤️

@zpfz
Copy link
Owner

zpfz commented May 29, 2021

晚上我测试了下,目前只能暂时用 css 进行覆盖。

好的,那我也先手动了。
后面可以考虑暴露个配置❤️

这个肯定会的😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants