You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -107,6 +101,20 @@ import githubDark from '@shikijs/themes/github-dark'
107
101
Highlight code with different themes for light and dark modes. Both palettes are embedded as CSS custom properties, so there is no flash on theme switch. See all [available themes →](https://shiki.style/themes)
108
102
109
103
```typescript
104
+
highlight({
105
+
themes: {
106
+
light: 'github-light',
107
+
dark: 'github-dark'
108
+
}
109
+
})
110
+
```
111
+
112
+
You can also pass theme registration objects (for example from `@shikijs/themes`) when you want explicit control over what gets bundled:
@@ -209,7 +217,7 @@ Returns a `ComarkPlugin` that enables Shiki syntax highlighting.
209
217
210
218
| Option | Type | Default | Description |
211
219
|---|---|---|---|
212
-
|[`themes`](#options-themes)|`object`| Material themes | Light and dark theme registrations |
220
+
|[`themes`](#options-themes)|`object`| Material themes | Light and dark theme names or registrations |
213
221
|[`languages`](#options-languages)|`LanguageRegistration[]`|`undefined`| Languages to preload |
214
222
|[`transformers`](#options-transformers)|`ShikiTransformer[]`|`undefined`| Shiki transformers applied to every block |
215
223
|[`preStyles`](#options-prestyles)|`boolean`|`false`| Add inline background/foreground styles to `<pre>`|
@@ -218,21 +226,18 @@ Returns a `ComarkPlugin` that enables Shiki syntax highlighting.
218
226
219
227
### `themes`
220
228
221
-
Theme configuration for light and dark modes. Import from `@shikijs/themes`.
229
+
Theme configuration for light and dark modes. Each value can be a [bundled theme name](https://shiki.style/themes) string (resolved from `shiki`) or a theme registration object.
0 commit comments