Changing the theme in Slidev is surprisingly easy. All you need to do is to add the
theme: field in your frontmatter.
--- theme: seriph ---
You can start the server, which will prompt you to install the theme automatically
? The theme "@slidev/theme-seriph" was not found in your project, do you want to install it now? › (Y/n)
or install the theme manually via
$ npm install @slidev/theme-seriph
And that's all, enjoy the new theme! For more details about the usage, you can refer to the theme's README.
Want to share your theme? Learn about how to write a theme.
If you want to get full control of the current theme, you can eject it to your local file system and modify it as you want. By running the following command
$ slidev theme eject
It will eject the theme you are using currently into
./theme, and changed your frontmatter to
--- theme: ./theme ---
This could also be helpful if you want to make a theme based on an existing one. If you do, remember to mention the original theme and the author 😃
As you probably found out from the previous section, you can have a local theme for your project. By having a relative path in your theme field.
--- theme: ./path/to/theme ---
Refer to how to write a theme for more details.