Okay I figured it out, it's very easy.
- Within Custom Types screen in the prismic admin, Add the "labels" key (not "label" which is the actual label for the field) and value to your
config
block within your StructuredText field:
"example_rich_text": {
"type": "StructuredText",
"config": {
"single": "paragraph",
"label": "Rich Content",
"placeholder": "Rich Content",
"labels": ["inline-code"]
}
}
- Save and go to a document using this Custom Type.
- Select the text you want to be inline-code
- In the toolbar there is an icon for customs labels that looks like this
- Click it and select inline-code from the dropdown.
- Publish your document.
- Using CSS in your app, style the span that's rendered now with a class of
.inline-code
, perhaps something like this
.inline-code {
background-color: lightgray;
display: inline-block;
padding: 0 .5ch;
margin: 0 .5ch;
font-family: monospace;
}
That's it!