Skip to content

docs: supplement responsive usage #1642

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

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
Copy link

pkg-pr-new bot commented Apr 24, 2025

Open in StackBlitz

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

commit: c18d16b

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests βœ…

Project coverage is 62.97%. Comparing base (c4bba1b) to head (c18d16b).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1642   +/-   ##
=======================================
  Coverage   62.97%   62.97%           
=======================================
  Files          77       77           
  Lines        3795     3795           
  Branches      433      433           
=======================================
  Hits         2390     2390           
  Misses       1378     1378           
  Partials       27       27           

β˜” 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