Can I format Rich Text code?


I have a Rich text element that I’m using to display Markdown formatted text.
But I’d like to show the code in a different color.

Is that possible? I know I can edit many tags, but code isn’t among them.

You can use CSS to target and style it (the <code> block). You can insert this CSS into a style tag in a HTML element, or use any of the various other methods described in the community. If you have any other elements, you can use a custom class on the rich text to scope the style only to that element.

Like Broberto mentioned, styling it in the HTML should work.

Broberto actually helped me implement a more robust rich text component which should be coming soon :eyes: makes styling everything much easier and feels more like editing in Notion.
Preview it here

DM me if you’re interested!

3 Likes