Vuepress: Would you mind add a light(white) code background?

Created on 5 Mar 2019  路  7Comments  路  Source: vuejs/vuepress


Feature request



What problem does this feature solve?

image
Like this picture, when I change the codeBgColor into white, some words become invisible.

What does the proposed API look like?

How should this be implemented in your opinion?

I have used Prism.js but failed.

Are you willing to work on this yourself?**

Yes, would you mind give me some suggestions?

feature request

Most helpful comment

You can import theme stylesheet in index.styl or Layout.vue:

@import "prismjs/themes/prism-tomorrow.css"
// currently used, but you can specify another

Also, we have planned to enhance code snippet in the next two months.

All 7 comments

You can import theme stylesheet in index.styl or Layout.vue:

@import "prismjs/themes/prism-tomorrow.css"
// currently used, but you can specify another

Also, we have planned to enhance code snippet in the next two months.

Like https://github.com/vuejs/vuepress/issues/736, currently, when we import another Prism theme, the default theme (Tomorrow) hard-coded in layout.vue will override the one imported.

@kidonng thank you for your working, is there some docs to be written in the future?

@kidonng thank you for your working, is there some docs to be written in the future?

About what? If you are looking for a minimal workaround, check out Theme Inheritance feature introduced in 1.x.
Here's an example used in my project, it is basically a copy of layouts/Layout.vue (with Prism theme removed) and utils/index.js (which can't be inherited). Add these files and you should be able to customize code background as you wish 馃槂

@kidonng
thank you very much, I think we could write some documentation to help people who need help about this, it is a good job, isn't it?

thank you very much, I think we could write some documentation to help people who need help about this, it is a good job, isn't it?

It is better to fix the problem instead 馃榿 I have created a pull request.

As v1.0.3 has released, you should be able to customize the code theme now.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

shaodahong picture shaodahong  路  3Comments

ynnelson picture ynnelson  路  3Comments

kid1412621 picture kid1412621  路  3Comments

genedronek picture genedronek  路  3Comments

gaomd picture gaomd  路  3Comments