nuxt / nuxt/image

Srcset and Size when applied don’t render html as when applied on <img> tag

Open
#1,507 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
1.5k
Forks
331
Avg merge
19h 52m
Merged PRs (30d)
9

Description

When using img tag, browser breakpoints behave as they should.
Desired behaviour:

Here is a public codepen to exemplify. (feel free to play with example)

https://codesandbox.io/p/devbox/7t824m
https://7t824m-3000.csb.app/

But with nuxtimg,same parameters, can’t obtain the same behaviour on the 3 breakpoints.

What i tried:
-using min-width,changing the dpr.

Any suggestion or ideea is welcomed.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the public CodeSandbox reproduction and inspecting the NuxtImg-generated HTML, responsive srcset/sizes behavior, and network requests while resizing the viewport. No project file or test is named; done means matching the native img behavior across the described breakpoints and producing the expected responsive HTML.

Written by the indexing model from the issue text.

Assessment

Tech stack
nuxt, typescript
Domain
frontend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.