这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@poppingmoon
Copy link
Owner

Added the ability to change colors in the code block.

The following settings can be configured by installing a custom theme.

{
  id: '',
  name: '',
  props: {
    // ...
  },
  codeHighlighter: {
    base: 'rose-pine-dawn', // Theme id from Shiki or Highlight.js.
    overrides: {
      fg: '#111111',        // Default foreground color.
      bg: '#ffffff',        // Background color.
      colorReplacements: {  // A map of color names to new color values.
        '#286983': '#86b300', 
      },
    },
  },
}

For the list of themes available in Shiki and Highlight.js, see https://shiki.style/themes#bundled-themes and https://github.com/highlightjs/highlight.js/tree/main/src/styles.

@poppingmoon poppingmoon merged commit 3b156de into main Jun 10, 2025
14 checks passed
@poppingmoon poppingmoon deleted the shiki branch June 10, 2025 13:22
@poppingmoon poppingmoon mentioned this pull request Jun 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants