Replies: 9 comments 6 replies
|
You can install @tailwindcss/typography and wrap editor component with |
|
Running into the same problem. |
|
Did anyone find a fix for this yet? |
|
Found a decent fix. If you install @tailwindcss/typography and in your tailwind.config.js file add: Then in your jsx add that 'whateverNameYouWantHere' to your editor-container as a class like this: This will remove tailwinds preflight styles from anything inside the 'whateverNameYouWantHere' meaning you can leave it as it is OR you can add custom styles to the editor in your App.css file: eg. .whateverNameYouWantHere h1 { Works on my machine............ |
|
For everyone is looking for a "clean" fix: and paste this into your scss file: .ce-block__content{
@apply prose
} |
|
Has anyone made Editorjs work with Nextjs and Tailwind? |
|
Hi everyone, if you think Tailwind typography is not exactly a good fit, I wrote this custom typography class which I think is good, and similar to the original: |
|
From tailwind documentation https://tailwindcss.com/docs/preflight#disabling-preflight Instead of
make
|
|
Better Solution Without Installing Any New Library Just replace: @import "tailwindcss";with: @layer theme, base, components, utilities;
@import "tailwindcss/preflight.css" layer(base);
@import "tailwindcss/theme.css" layer(theme);
@import "tailwindcss/utilities.css" layer(utilities);
@layer base {
#editorjs :where(h1, h2, h3, h4, h5, h6, p, ul, ol, li, blockquote, pre, code) {
margin: revert;
padding: revert;
font-size: revert;
font-weight: revert;
line-height: revert;
font-family: revert;
list-style: revert;
}
}The solution lies in this block: @layer base {
#editorjs :where(h1, h2, h3, h4, h5, h6, p, ul, ol, li, blockquote, pre, code) {
margin: revert;
padding: revert;
font-size: revert;
font-weight: revert;
line-height: revert;
font-family: revert;
list-style: revert;
}
}This approach reverts the default browser styles for typography elements within the |
Uh oh!
There was an error while loading. Please reload this page.
How to make EditorJS works with tailwindcss? Currently Tailwind is overwrite the heading styling. Is there any changes could be made?
All reactions