Adding styling to a new blockContent separator in Slack thread

1 replies
Last updated: Jul 23, 2020
Hi! I’m trying to extend blockContent by adding in a new
style
, a separator that returns an
<hr />
. I added this in and it works:
{ title: "Separator", value: "hr" },
– but is there a way to specify styling for this element? Basically some kind of preview so that my editors can know that that blank line is a special blank line?
Jul 23, 2020, 9:04 AM
I mostly figured out how to do this – adding
            blockEditor: {
              render: separatorRender
            }
but the
separatorRender
, a React component that returns a styled
span
, is applied both to the text in the editor and to what’s in the drop-down menu in the editor toolbar. Is there a way to address these separately?
Jul 23, 2020, 10:49 AM

Sanity– build remarkable experiences at scale

The Sanity Composable Content Cloud is the headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Was this answer helpful?

Categorized in