From 07d0c8c7551c33d91073065d354f4dd603aabdeb Mon Sep 17 00:00:00 2001 From: Julie Ng Date: Wed, 7 Jan 2026 20:44:29 +0100 Subject: [PATCH 1/2] docs(readme): draft changes for clarifying options --- README.md | 36 ++++++++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 1c657a1..75b3b37 100644 --- a/README.md +++ b/README.md @@ -43,11 +43,35 @@ export default defineNuxtConfig({ Available options: -- `bundledThemes` and `bundledLangs` can be configured to set bundled themes and languages. -- `defaultTheme` and `defaultLang` can be configured to set default theme and language. -- `dynamic` can be configured to set whether languages are dynamically loaded. (in this way, all languages will be bundled) -- `langAlias` can be configured to set language aliases. -- `highlightOptions` can be configured to set highlight defaults. +| Property | Type | Description | +|:--|:--|:--| +| `bundledLangs` | Array | Refer to the Shiki docs for a [list of supported languages](https://shiki.style/languages). | +| `bundledThemes` | Array | List of themes to bundle, e.g. `['min-light', 'min-dark']` | +| `defaultLang` | String | Sets the default language. | +| `defaultTheme` | String or Object | Configure a single default theme, e.g. `github-light` or different themes for light and dark modes. See example below. | +|`dynamic` | Boolean | Set to `true` to dynamically load Languages, which bundles all languages. Refer to Shiki docs on [Bundles](https://shiki.style/guide/bundles) to understand how lazy dynamic imports work.| +| `langAlias` | Object | Set language aliases, e.g. `{ 'my-lang': 'javascript' }` | +| `highlightOptions` | ? | Set highlight defaults. | + +### Custom Themes for light and dark mode + +By [default](./src/module.ts) nuxt-shiki comes bundled with the `min-light` and `min-dark` [themes](https://shiki.style/themes). To use different themes, update the `bundledThemes` and `defaultTheme` properties, for example: + +```js +export default defineNuxtConfig({ + modules: ['nuxt-shiki'], + shiki: { + bundledThemes: ['github-light', 'material-theme-palenight'], + defaultTheme: { + light: 'github-light', + dark: 'material-theme-palenight' + } + } +}) +``` + +> [!NOTE] +> Themes can only be configured via the `defaultTheme` option. It is not possible to override themes in the `` component. ## `` component @@ -154,4 +178,4 @@ npm run test:watch # Release new version npm run release -``` \ No newline at end of file +``` From 22039234d723eadee2f0898d244ad7c8527e3c1f Mon Sep 17 00:00:00 2001 From: Restent Ou Date: Thu, 8 Jan 2026 17:52:36 +0800 Subject: [PATCH 2/2] Update types in README for configuration options --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 75b3b37..ff923c6 100644 --- a/README.md +++ b/README.md @@ -45,13 +45,13 @@ Available options: | Property | Type | Description | |:--|:--|:--| -| `bundledLangs` | Array | Refer to the Shiki docs for a [list of supported languages](https://shiki.style/languages). | -| `bundledThemes` | Array | List of themes to bundle, e.g. `['min-light', 'min-dark']` | -| `defaultLang` | String | Sets the default language. | -| `defaultTheme` | String or Object | Configure a single default theme, e.g. `github-light` or different themes for light and dark modes. See example below. | +| `bundledLangs` | `BundledLanguage[]` | Refer to the Shiki docs for a [list of supported languages](https://shiki.style/languages). | +| `bundledThemes` | `BundledTheme[]` | List of themes to bundle, e.g. `['min-light', 'min-dark']` | +| `defaultLang` | `BundledLanguage` | Sets the default language. | +| `defaultTheme` | BundledTheme \| Record<'dark' \| 'light' \| (string & {}), BundledTheme> | Configure a single default theme, e.g. `github-light` or different themes for light and dark modes. See example below. | |`dynamic` | Boolean | Set to `true` to dynamically load Languages, which bundles all languages. Refer to Shiki docs on [Bundles](https://shiki.style/guide/bundles) to understand how lazy dynamic imports work.| -| `langAlias` | Object | Set language aliases, e.g. `{ 'my-lang': 'javascript' }` | -| `highlightOptions` | ? | Set highlight defaults. | +| `langAlias` | `Record` | Set language aliases, e.g. `{ 'my-lang': 'javascript' }` | +| `highlightOptions` | `HighlightOptions` | Set highlight defaults. | ### Custom Themes for light and dark mode