Skip to content

Commit

Permalink
docs: added colorReplacements example (#602)
Browse files Browse the repository at this point in the history
Co-authored-by: Anthony Fu <github@antfu.me>
  • Loading branch information
elkmod and antfu committed Feb 23, 2024
1 parent 2f33bff commit aba8131
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions docs/guide/theme-colors.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,21 @@ Learn more about how to [load themes](./load-theme).

You can also use the `colorReplacements` option to replace the color values of the theme. This is useful when you want to use a theme with a different color palette. It can be provided on both the theme object and the `codeToHast` `codeToHtml` options.

The `colorReplacements` object should follow a color-to-color format, where the keys represent the color to be replaced and the value represents the new color:

```js
const html = await codeToHtml(
code,
{
lang: 'js',
theme: 'min-dark',
colorReplacements: {
'#ff79c6': '#189eff'
}
}
)
```

## CSS Variables Theme

::: warning Experimental
Expand Down

0 comments on commit aba8131

Please sign in to comment.