Skip to content

Commit

Permalink
Add details to Shiki customization section (#11134)
Browse files Browse the repository at this point in the history
Co-authored-by: Sarah Rainsberger <[email protected]>
  • Loading branch information
HiDeoo and sarah11918 authored Mar 4, 2025
1 parent 38e1afe commit 023a8ae
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/content/docs/en/guides/syntax-highlighting.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,12 @@ export default defineConfig({

### Customizing Shiki themes

You can follow [Shiki's own theme documentation](https://shiki.style/themes) for more customization options for themes, light vs dark mode toggles, or styling via CSS variables.
You can follow [Shiki's own theme documentation](https://shiki.style/themes) for more customization options for themes, [light vs dark mode toggles](https://shiki.style/guide/dual-themes), or styling via [CSS variables](https://shiki.style/guide/theme-colors#css-variables-theme).

Astro code blocks are styled using the `.astro-code` class, so you will need to replace the `.shiki` class in the examples with `.astro-code`.
You will need to adjust the examples from Shiki's documentation for your Astro project by making the following substitutions:

- Code blocks are styled using the `.astro-code` class instead of `.shiki`
- When using the `css-variables` theme, custom properties are prefixed with `--astro-code-` instead of `--shiki-`

## Components for code blocks

Expand Down

0 comments on commit 023a8ae

Please sign in to comment.