Theme Config

Mr.Hope ... 2020-5-9 Basic
  • Vuepress
Less than 1 minute

# Using a theme

Using a theme is almost the same as using a plugin.

# Using a theme from a dependency

Themes can be published on npm in raw Vue SFC format as vuepress-theme-xxx.

module.exports = {
  theme: "vuepress-theme-xx",
};
1
2
3

If you prefix the theme with vuepress-theme-, you can use a shorthand to leave out that prefix:

module.exports = {
  theme: "xxx",
};
1
2
3

Same with:

module.exports = {
  theme: "vuepress-theme-xxx",
};
1
2
3

This also works with Scoped Packages (opens new window):

module.exports = {
  theme: "@org/vuepress-theme-xxx", // or an official theme: '@vuepress/theme-xxx'
};
1
2
3

Shorthand:

module.exports = {
  theme: "@org/xxx", // or an official theme: '@vuepress/xxx'
};
1
2
3

Note

The theme whose name starts with @vuepress/theme- is an officially maintained theme.