Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The rendered image height is incorrect. #343

Closed
jwcesign opened this issue Mar 29, 2024 · 2 comments
Closed

The rendered image height is incorrect. #343

jwcesign opened this issue Mar 29, 2024 · 2 comments
Assignees

Comments

@jwcesign
Copy link

jwcesign commented Mar 29, 2024

What version of @tailwindcss/typography are you using?

0.5.12

What version of Node.js are you using?

v18.16.1

What browser are you using?

chrome

What operating system are you using?

Windows

Reproduction repository

https://github.com/jwcesign/md-render

Describe your issue

With the original official react-markdown demo(https://remarkjs.github.io/react-markdown/), it renders correct for : https://raw.githubusercontent.com/alist-org/alist/v3.33.0/README.md
image

But with my demo project, it does not work fine for the big log:
image

After I change from height to width, it works fine: AlistGo/alist#6282

@jwcesign
Copy link
Author

BTW, nice project, thanks for your hard work!

@reinink reinink self-assigned this Aug 7, 2024
@reinink
Copy link
Member

reinink commented Aug 7, 2024

Hey! So technically this isn't an issue with the Typography plugin, but rather it's being caused by the Preflight styles in Tailwind CSS:

https://github.com/tailwindlabs/tailwindcss/blob/b01283cc9b66cf830d87cbfe1fbb5ebb8561226a/src/css/preflight.css#L369-L377

This is something we might eventually change, as there has been discussion about this previously:

tailwindlabs/tailwindcss#506
tailwindlabs/tailwindcss#7742

Until then, one trick you can use to undo these Preflight styles is to use revert-layer:

img {
  height: revert-layer;
}

Alternatively, you could also set an explicit hight for this image using a creative attribute selector — something like this:

img[alt="logo"]{
  height: 100px;
}

Hope that helps! 👍

@reinink reinink closed this as completed Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants