Skip to content

Option to customize Shiki Theme in CodeBlockContent #1335

Closed
@vansickn

Description

@vansickn

Is your feature request related to a problem? Please describe.

Currently, the only syntax highlighting for the CodeBlock is github-dark. My use-case has the code block styled in a different theme, and the text is currently unreadable on my background color. Therefore, it would be convenient if I was able to pass in a different shiki theme to match the background.

Describe the solution you'd like

The ability to pass an optional theme parameter into the customizeCodeBlock function that's exposed. Or, if there's a simpler way to do it I'm okay with that too. Optionally, you may think passing a fully constructed highlighter is the best way forward.

Describe alternatives you've considered

  1. I could leave the code block styled as is, but it would go against the theming of my application.
  2. Could fork the component and pass it in as a custom block, but I assume others would want this capability as well.

Additional context

I had a custom code block implementation before, but I really love the simplicity of the one in blocknote! Would love to see some styling optionality though.

I'm also happy to give this a try and submit a PR if that is something @YousefED would be okay with.

Bonus
[ ] I'm a sponsor and would appreciate if you could look into this sooner than later 💖

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions