Search code examples
htmlcssmarkdowntailwind-csseleventy

Is there a way to stop tailwind from overriding markdown default spacing?


I'm writing a blog using eleventy (with nunjucks) and tailwind.

Whenever I write a post using markdown and disabling tailwind, everything is fine. but when I enable tailwind, the line break (2-space and enter at end of line) stops working, so everything looks like one big paragraph. In other words:

without tailwind, this paragraph (in markdown)

Hello  

World

looks like this

Hello

World

with tailwind, it looks like

Hello

World

How can I do to write markdown without tailwind overriding the default markdown spacing?


Solution

  • So I finally got with a solution. Tailwind has a plugin called 'typography'. Once you install it, add prose as a class to the parent element of the markdown content. This is a built-in tailwind class that will help you default settings of spacing, font, color.