Change default font size of key text

I have a text slice like the below:

I use the Slice Hash Link field for an anchor to the section, and I use the Slice Title field for a <h2> tag in my document.

Just from a UI perspective, it would be nice if we could select what the key text field is styled as - something like this:

image

Hey Max,

I think that might remove the point of the key text field if it’s not just a string.

Is there any reason you don’t use a rich text field, which has this behaviour, here?

I’d still want it to be key text, because that’s really useful on the front-end side because I get just a string back.

I’m not using rich text because all I want is a <h2> tag with no extra formatting.

It’s purely from a stylistic point of view in the writing room. Just to give a bit of visibility to the fact I’m using this key text field as a title.

In that case could you use a Title field with only the H2 option enabled, that way you can only ever create a H2.

Also another option would be to pass that specific key text in to a H2 tag on the front-end.

Would a H2 title field return rich text, or just a plain string?

I'm doing this at the moment, it would just be nice for the UI to reflect that on the prismic side. Otherwise it's easy to miss that it is a title, if that makes sense.

It would return rich text, but only as a H2 tag once processed.

Yeah that makes sense, I suppose the only solution for now would be to use the placeholder to make it clear that you’re sending it to a H2/title tag.

I’ll log this as a feature request so the team can see it. They’ll ask any questions about your use case if/when they have any here.

1 Like

This is being tracked as an open feature request.

If you have another use-case for this feature, you can 'Flag' this topic to reopen. Please use the :heart: button to show your support for the feature and check out our Feature Request Guidelines.