docs icon indicating copy to clipboard operation
docs copied to clipboard

fix: add reactive theme content

Open kieranwv opened this issue 11 months ago • 9 comments

Description (required)

In shiki's configuration, I set experimentalThemes: { } as documented, but it doesn't work when I dynamically switch dark mode and light mode.

image

output (1)

Then I checked the official documentation of shiki and found that I need to manually set some css fragments to get reactive dark mode.

image

I replaced the .shiki class name with .astro-code and added the code to my documentation project and now it works fine.

output

I added this usage to the document, hoping to help developers who are unfamiliar with shiki. 😀

kieranwv avatar Mar 07 '24 12:03 kieranwv