sjdemartini / mui-tiptap

A Material UI (MUI) styled WYSIWYG rich text editor, using Tiptap
MIT License
320 stars 44 forks source link

Don't apply built-in styles #221

Open joelburget opened 7 months ago

joelburget commented 7 months ago

Is your feature request related to a problem? Please describe.

In my application (letter editor for openletter.net) we already have styles and don't want to apply any from src/styles.ts. It would be nice if we could turn this off.

Describe the solution you'd like

I'll focus on RichTextEditor since that's the component we're using, but I assume the same would apply to RichTextContent, etc. If there was a prop applyDefaultStyles which could default to true, I think that would solve the problem.

<RichTextEditor applyDefaultStyles={false} />

Describe alternatives you've considered

None that seem good.

joelburget commented 7 months ago

I should add that I'd be happy to contribute this if we settle on a design that you're happy with.

sjdemartini commented 7 months ago

I hadn't considered this before. Are you specifically referring to styles within the editor content (i.e. the Prosemirror/Tiptap rich text content itself), as opposed to the surrounding mui-tiptap stuff (outlined field, menu bar, etc.)? Understandable suggestion and there isn't a clean workaround right now, since you'd have to (seemingly painstakingly) override each separate style.

joelburget commented 6 months ago

That's exactly right. I'm happy with the surrounding mui-tiptap stuff, so I only care about the editor content.

markdon commented 1 day ago

The imposed styles (margin removals, text sizes, etc) make the content inside the editor inconsistent with content/UI outside of the editor. For now, I have some CSS that undoes some of the most obvious inconsistencies.