-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Font sizes of headings cannot be overridden in MenuSelectHeading
#186
Comments
Weird, seems like it takes mui h4 typography settings. Forked example code: https://codesandbox.io/p/devbox/mui-tiptap-demo-forked-99lnfr?file=%2Fsrc%2FApp.tsx |
Update1: Right I see it uses mui theme heading sizes but skipped. This should be better documented.. Also is possible to ovewrite these font sizes in menuHeadingSelect without changing theme? In example it is only in editor, but this popper is on the top of Dom. I think you shouldn't use theme font sizes same as in h1 or enable to overwrite it. Or my personal best solution count other headings based on your h1. |
@RuckieOfficial I'm not sure I entirely follow what the issue you're reporting is. Is it that you want each heading style to match the MUI default heading font sizes? For what it's worth, I left a comment in the code about my decision on those styles: Lines 51 to 53 in 9e4bbb5
In other words, I found the MUI default theme styles for h1 to be useful for something like a landing page hero, but not practical inside a document or similar (like a Tiptap rich text editor), hence choosing smaller heading font sizes all the way down. There's quite a lot to cover in the README as is, so I haven't documented stuff that seems more minor, like decisions around particular default styles in mui-tiptap. You can override styles for anything in the rich text editor, like in this example (same as in the CodeSandbox linked from the README): mui-tiptap/src/demo/Editor.tsx Lines 129 to 138 in 0ad9992
This won't automatically override styles for the If you could please clarify your issue, that would help. Thanks. |
@sjdemartini I agree that default fonts are huge. Now you have custom h1 font size and other font sizes are from theme. But if you use custom font sizes in project, headings > h1 could be way larger or smaller than h1. And we use only h1 - h4 in our project with custom sizes, but you use more headings so headings > h4 could be larger or smaller too in that case. I tried override headings in editor and it works just fine, but how u say it doesn't impact MenuSelectHeading at all which is not good, because it is not consistent then. I hope I made it more clear now. Edit: Long story short I think it would be optimal to not using theme font sizes at all in MenuSelectHeading and define it similarly as in h1 heading. Edit2: It gotta be changed globally for headings because MenuSelectHeading is using default headings styles. Edit3: Something like: |
MenuSelectHeading
Not proud of this one, but you can hack
|
Which packages did you experience the bug in?
starter-kit
What Tiptap version are you using?
2.1.13
What’s the bug you are facing?
I have default settings and in the heading menu select heading h2 is 0.75 rem instead of 1.75rem.
extensions={[StarterKit, ...extension]}
In my custom extensions is not anything, that overrides heading config.
What browser are you using?
Chrome
Code example
No response
What did you expect to happen?
I expected that font sizes go chronologically.
Anything to add? (optional)
No response
Did you update your dependencies?
The text was updated successfully, but these errors were encountered: