2 Replies
Hi @fsnkty. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Based on the knowledge sources, Nuxt Content uses Shiki for code highlighting and supports specifying multiple themes for different color modes (e.g., light/dark) in your
Your configuration matches the documented approach for multiple Shiki themes in Nuxt Content. If only the default theme is ever used, the knowledge sources do not provide a direct solution or explanation for this issue. You may need to verify your color mode setup or consult further resources or GitHub issues for potential bugs or workarounds. Docs > Getting-started >
nuxt.config.ts
under content.build.markdown.highlight.theme
. Your configuration is correct in structure:
According to the documentation, this setup should apply github-light
in the default (light) mode and github-dark
when the page is in dark mode. The theme switching is compatible with the Color Mode module, and the documentation specifically notes:
If you are using multiple themes, it's recommended to always have aHowever, if you are finding that only thedefault
theme specified.
...
This option is compatible with Color Mode module.
If you are using multiple themes, it's recommended to always have adefault
theme specified.
Docs > Getting-started >highlight
default
theme is ever used and the dark
theme is ignored, the knowledge sources do not provide troubleshooting steps or known issues for this specific problem. The documentation assumes that, when the color mode changes (e.g., via the Color Mode module or a class on <html>
), the correct theme will be applied automatically.
Possible causes (based on documentation):
- The color mode is not being set or switched correctly in your app, so the dark
theme is never triggered.
- The integration between @nuxt/content
and the color mode module may not be working as expected, or the required class (e.g., dark
on <html>
) is missing.
- There may be a limitation or bug not covered in the documentation.
What you can check:
- Ensure you have the Color Mode module enabled and configured if you want automatic theme switching.
- Make sure the dark
class is being applied to the <html>
element when in dark mode, as this is how Nuxt Content detects which theme to use.
- If you are not using the Color Mode module, you may need to manually toggle the class or ensure your dark mode logic is compatible.
Summary:Your configuration matches the documented approach for multiple Shiki themes in Nuxt Content. If only the default theme is ever used, the knowledge sources do not provide a direct solution or explanation for this issue. You may need to verify your color mode setup or consult further resources or GitHub issues for potential bugs or workarounds. Docs > Getting-started >
highlight
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@1127233765471694909> Kapa.ai is still learning and improving, please let me know how I did by reacting below.