Skip to content

MDX with NextJS & Tailwind #2568

Answered by ChristianMurphy
orrymr asked this question in Q&A
Discussion options

You must be logged in to vote

My first issue was that mdx-components.tsx didn't work when I put it in the /app directory. I had to put it one level up.

That is next.js specific, raise this with them

But the result looks pretty bad:

Yep, the tailwind defaults are atrocious.
It's a regular question https://github.com/orgs/mdx-js/discussions?discussions_q=is%3Aopen+tailwind

The answer is to use tailwind prose for better defaults https://dev.to/adamof/introduction-to-the-prose-class-that-instantly-beautifies-articles-tailwindcss--bn7

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by orrymr
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants