Image size set to `1w` if sizes is set to `100vw`
Open
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.5k
- Forks
- 331
- Avg merge
- 19h 52m
- Merged PRs (30d)
- 9
Description
Somehow 100vw will be converted to a 1w and 2w url and I don't understand why.
Local
<img
sizes="(max-width: 640px) 100vw, (max-width: 768px) 50vw, 400px"
srcset="
/_ipx/w_1/twitter-image.png 1w,
/_ipx/w_2/twitter-image.png 2w,
/_ipx/w_320/twitter-image.png 320w,
/_ipx/w_400/twitter-image.png 400w,
/_ipx/w_640/twitter-image.png 640w,
/_ipx/w_800/twitter-image.png 800w
"
src="/_ipx/w_800/twitter-image.png"
/>
Storyblok
<img
sizes="(max-width: 640px) 100vw, (max-width: 768px) 50vw, 400px"
srcset="
https://a.storyblok.com/f/23194/3000x2000/09das0980/image.png/m/1x0 1w,
https://a.storyblok.com/f/23194/3000x2000/09das0980/image.png/m/2x0 2w,
https://a.storyblok.com/f/23194/3000x2000/09das0980/image.png/m/320x0 320w,
https://a.storyblok.com/f/23194/3000x2000/09das0980/image.png/m/400x0 400w,
https://a.storyblok.com/f/23194/3000x2000/09das0980/image.png/m/640x0 640w,
https://a.storyblok.com/f/23194/3000x2000/09das0980/image.png/m/800x0 800w
"
src="https://a.storyblok.com/f/23194/3000x2000/09das0980/image.png/m/800x0"
/>
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the generated srcset from the Local example and compare it with the Storyblok output. Trace the responsive image-size calculation that turns 100vw into 1w and 2w. Done means the generated widths correctly reflect the sizes value without breaking the other listed widths.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- nuxt, typescript
- Domain
- frontend, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100