Skip to content

Conversation

@a1mersnow
Copy link

@a1mersnow a1mersnow commented Dec 20, 2024

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Try to help beginners use <NuxtImg>'s responsive features.

I changed the example below <NuxtImg>'s sizes property:

<!-- before -->
<NuxtImg
  src="/logos/nuxt.png"
  sizes="100vw sm:50vw md:400px"
/>
<!-- after -->
<NuxtImg
  src="/logos/nuxt.png"
  sizes="300px sm:50vw md:400px"
/>

And I recommend giving a pixel value for the default size.

If you use 100vw as the default size, you will get srcsets of 1w and 2w which do not make sense.

@a1mersnow a1mersnow requested a review from danielroe as a code owner December 20, 2024 01:16
@pkg-pr-new
Copy link

pkg-pr-new bot commented Apr 24, 2025

Open in StackBlitz

npm i https://pkg.pr.new/@nuxt/image@1642

commit: 1ad4292

@codecov-commenter
Copy link

codecov-commenter commented Apr 24, 2025

Codecov Report

βœ… All modified and coverable lines are covered by tests.
βœ… Project coverage is 7.02%. Comparing base (62998ab) to head (1ad4292).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@          Coverage Diff          @@
##            main   #1642   +/-   ##
=====================================
  Coverage   7.02%   7.02%           
=====================================
  Files         77      77           
  Lines       3575    3575           
  Branches     138     138           
=====================================
  Hits         251     251           
  Misses      3276    3276           
  Partials      48      48           

β˜” View full report in Codecov by Sentry.
πŸ“’ Have feedback on the report? Share it here.

πŸš€ New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • πŸ“¦ JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Successfully merging this pull request may close these issues.

3 participants