Code block and highlighting using Prism.
Vaadin mapping for my <code-block> element.
Creating a new
<code-block> element is easy.
You can specify the theme.
If you want to remove the theme's background graphics, use
This code is under the BSD 3-Clause.
If you like my work and want to support it, please consider sponsoring me. It's how I make the time to code great things!
If you're already using prism-element by Johannes Goebel, there's probably no reason to switch. The main difference is that I implemented a custom web component with Lit that uses Prism directly while Johannes used Polymer's prism-element. Also, I handle language and theme importing differently.
Was this helpful? Need more help?
Leave a comment or a question below. You can also join the chat on Discord or ask questions on StackOverflow.
- BSD 3-clause "New" or "Revised" License
- Vaadin 14+