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

next/image add additional pixels to parent element without a trace #18911

Closed
rayriffy opened this issue Nov 6, 2020 · 4 comments
Closed

next/image add additional pixels to parent element without a trace #18911

rayriffy opened this issue Nov 6, 2020 · 4 comments
Labels
bug Issue was opened via the bug report template.

Comments

@rayriffy
Copy link

rayriffy commented Nov 6, 2020

Bug report

Describe the bug

Chrome debugger says that next/image element is an exact square (1st image) but parent element have additional 6px adds up without a trace (2nd image).

This only happens in 10.0.1 not 10.0.0

Screen Shot 2020-11-07 at 5 59 00

Screen Shot 2020-11-07 at 5 59 10

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Checkout sekai-next at commit rayriffy/sekai-next@f3bbdbe
  2. yarn dev or https://sekai-next-kcv87uh9y.vercel.app/
  3. Go to /music or click at Music tab on navigation
  4. Happy debugging

Expected behavior

This is captured when I revert to [email protected]

Screen Shot 2020-11-07 at 6 07 10

System information

  • OS: macOS 11
  • Browser (if applies): Chrome 86.0.4240.183
  • Version of Next.js: 10.0.1
  • Version of Node.js: 14.15.0

Additional context

Add any other context about the problem here.

@rayriffy rayriffy added the bug Issue was opened via the bug report template. label Nov 6, 2020
@nicholaschiang
Copy link
Contributor

@rayriffy this is a duplicate of #18915. Here's a temporary fix. All you've got to do is add the following styling to the parent wrapper:

.wrapper {
  letter-spacing: 0;
  word-spacing: 0;
  font-size: 0;
}

@Timer
Copy link
Member

Timer commented Nov 9, 2020

This mimics the default behavior of the <img /> component (which also has the text padding), so it's expected.

Closing as a duplicate of #18637, please voice any new layout requests there!

@P233
Copy link

P233 commented Jul 27, 2021

@nicholaschiang Why not add vertical-align: bottom to the inline-block built-in image wrapper? No need to style the parent wrapper.

@balazsorban44
Copy link
Member

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.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template.
Projects
None yet
Development

No branches or pull requests

5 participants