-
-
Notifications
You must be signed in to change notification settings - Fork 643
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support local theme json files #2398
Comments
Have you tried adding your theme like described here (docs were updated yesterday)? https://content.nuxt.com/get-started/configuration#highlight (third code block) Related issue: #2384 Edit: I think I misunderstood the issue. I don't know how to properly replace css variables theme |
I did, but it does not work. The theme file I am using is tomorrow.json. When using this file, the only error that appears in the terminal is:
In the generated HTML output, the code is just wrapped in a If I load a style that was included with shiki, such as dark-plus via an external JSON, it throws errors similar to the earlier one:
If I edit the json manually, and remove the line that reads
No more errors occur, however the code is still not styled. But unlike earlier, if I inspect the generated HTML, I do see the Finally, if I rename the theme in the corresponding json file, I get the same |
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days. |
This issue was closed because it has been stalled for 30 days with no activity. |
Could this make it into v3 please? Just like |
Is your feature request related to a problem? Please describe
With the migration to shikiji in 2.8.x, use of the
css-variables
theme is broken, rendering only black text. This is intentional, and documented by shikiji. I was using css-variables themes to load in a custom style of theme, as I was not able to get custom theme JSONs working.Describe the solution you'd like
I would like a mechanism to load and register any compatible JSON theme into shikiji, from the nuxt.config.js highlight property. Custom themes should be able to be loaded for both the "default" bare case, and for the object case, so I can load light, dark, and any other theme configuration. They should be able to do everything the built in themes can do.
Describe alternatives you've considered
I've thought about rewriting my ProseCode component to not use slot, and instead register my own Shikiji renderer, for the purposes of loading and using my own theme. This would do the job, but does not seem particularly efficient, as the MDC transformer for shikiji would still run.
I've thought about writing my own MDC transformer to add the custom theme I want, but this looks like it would become a maintenance burden as it drifts from the nuxt/content MDC transformer.
Additional context
Here is how it looks when it is broken:
Here is how it should look:
The text was updated successfully, but these errors were encountered: