Skip to content

Commit

Permalink
Document how to use a custom Shiki theme (#1749)
Browse files Browse the repository at this point in the history
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Co-authored-by: Kevin Zuniga Cuellar <46791833+kevinzunigacuellar@users.noreply.github.com>
  • Loading branch information
4 people authored Oct 28, 2022
1 parent b59e647 commit e0a5bba
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/pages/en/guides/markdown-content.md
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,22 @@ export default {
};
```
We also suggest [diving into their theme documentation](https://github.com/shikijs/shiki/blob/main/docs/themes.md#loading-theme) to explore loading custom theme, light vs dark mode toggles, or styling via CSS variables.
#### Adding your own theme
Instead of using one of Shiki’s predefined themes, you can import a custom theme from a local file.
```js title="astro.config.mjs"
import { defineConfig } from 'astro/config';
import customTheme from './my-shiki-theme.json';

export default defineConfig({
markdown: {
shikiConfig: { theme: customTheme },
},
});
```
We also suggest [diving into their theme documentation](https://github.com/shikijs/shiki/blob/main/docs/themes.md#loading-theme) to explore more about themes, light vs dark mode toggles, or styling via CSS variables.
#### Prism configuration
Expand Down

0 comments on commit e0a5bba

Please sign in to comment.