next/image having specificity issues with Tailwind Typography
See original GitHub issueBug report
Describe the bug
When using Tailwind Typography and the prose
element, it automatically adds margin-top and bottom to the img
element. This messes up the responsive-ness of the next/image
component.
To Reproduce
I’ve set a width and height
But it’s displayed wrong
Toggling these styles fixes it.
Expected behavior
I’d be great if we can build this into next/image
to prevent users from hitting issues with Tailwind Typography.
Screenshots
See repo.
System information
- OS: Mac
- Browser: Chrome
- Version of Next.js: 10.0.3
- Deployment: next start and Vercel
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Switching to Tailwind CSS - Lee Robinson
Learn why I switched my Next.js blog to use Tailwind CSS and how it impacted performance.
Read more >Building a Blog With Next Js with Markdown and Tailwind CSS
Create a basic blog using Next.js and Markdown.Code: https://github.com/theindianappguy/next-blog-markdownDemo: ...
Read more >Basic Features: Font Optimization - Next.js
Optimizing loading web fonts with the built-in `@next/font` loaders. ... To use the font on a single page, add it to the specific...
Read more >How to use Tailwind CSS with Next.js Image - Stack Overflow
I want to use Tailwind classes instead of the height and width property of the Next.js Image. But I can't because it throws...
Read more >@tailwindcss/typography - Tailwind CSS
Advanced topics. . Undoing typography styles. If you have a block of markup embedded in some content that shouldn ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi Lee, since tailwind 2.0 and the update on the typography plugin you are able to update styles that are applied via prose through your tailwind.config.js. I can imagine it being something like this:
But still it would be nice for people who don’t know about this feature that next/image fixes it.
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.