Display code with a selected theme and regex highlighting using Prism.js.
React
elements.
As you can see from the example dracula
theme though, there is a defined property called base
which is the styling for the pre
element that wraps the HTML being rendered.
For you to not need to defined a theme without any basis, or to not define one that already has been defined, we have many default themes exported from @react-email/code-block
.
These themes were generated by a bit of code that converts a CSS file for a prismjs theme into a object theme of these.
If you want to generate a theme from another existing prismjs theme you can do so by looking into this.
fontFamily: "..."
style for
all used elements of the componentPrismLanguage