Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to customize Shiki Theme in CodeBlockContent #1335

Open
vansickn opened this issue Dec 19, 2024 · 1 comment
Open

Option to customize Shiki Theme in CodeBlockContent #1335

vansickn opened this issue Dec 19, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@vansickn
Copy link

vansickn commented Dec 19, 2024

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 💖

@vansickn vansickn added the enhancement New feature or request label Dec 19, 2024
@sindras
Copy link

sindras commented Dec 20, 2024

This seems related to my past question in #1213. FYI @areknawo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants