-
Notifications
You must be signed in to change notification settings - Fork 39
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Is your feature request related to a problem? Please describe.
No, more a request for an enhancement.
Describe the solution you'd like
I'd like to be able to apply css classes directly to a PrismicRichText component via a prop.
Most of the time I would use it apply a class to a single RichText element for example a title used in a slice. However, when there are multiple fragments to serialize it makes sense to wrap the elements with a div and apply the class there. In the instance of the multiple lines, I understand there is an argument that the component could ignore the class and leave it to the developer to create the wrapping div, or for consistency have the PrismicRichText always apply the class.
Describe alternatives you've considered
- Wrapping the rich text field in an additional outer HTML tag to apply the class there.
- Creating a component that applies a custom serializer that applies the class.
- Using
asTextfor single elements and applying the markup manually, but this in-flexible for complex use cases where event a single fragment rich text field might be using labels in the writing room.
This limitation made more acute by frameworks like tailwindcss where the preference is to apply the class to the element.
Additional context
jodiedoubleday
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request