Unable to style editor with TailwindCSS #4556
-
|
Hello, I'm unable to style the editor with tailwind. I'm using the basic create-next-app project with the StarterKit tiptap example. I have the tailwind typography plugin and using prose, but my bullet points, headings, etc are all not being styled, they are inheriting from something called layout.css? in the inspector. Please advise!!! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
|
If I get rid of my editorProps and just use an imported CSS stylesheet, it works fine? why would that be? |
Beta Was this translation helpful? Give feedback.
-
|
I know this thread is pretty old, but I’m leaving my solution here in case someone else comes across this while searching for the answer. For some reason, the default CSS doesn’t apply, I’m not sure why but adding Tailwind CSS classes works perfectly So just copy and paste the snippet below into your global.css, and you’re good to go: |
Beta Was this translation helpful? Give feedback.
-
|
In general Tiptap absolutely is style-able via Tailwind. If you add the The Read more on the Tailwind docs here: https://tailwindcss.com/docs/adding-custom-styles#adding-base-styles |
Beta Was this translation helpful? Give feedback.




In general Tiptap absolutely is style-able via Tailwind. If you add the
proseclass to the editor's class attribute viaeditorProps.The
layout.cssOP is talking about is probably a Next.js layout.css that overrides styles globally and has nothing to do with Tiptap. In general - if you use Tailwind, make sure to not have other styles that globally override your Tailwind-styled elements or use CSS Layers to make sure Tailwind classes take a higher priority than external styles.Read more on the Tailwind docs here: https://tailwindcss.com/docs/adding-custom-styles#adding-base-styles